Skip to content

Commit

Permalink
Refactor: use sslip.io instead of xip.io
Browse files Browse the repository at this point in the history
sslip.io is much faster
  • Loading branch information
SukkaW authored and Netrvin committed Feb 22, 2019
1 parent 7373e9d commit 0b406a9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ Cloudflare Partner Management Panel
## 功能
* CNAME接入
* reCAPTCHA
* 设置回源地址为IP(基于xip.io)(默认关闭此功能)
* 设置回源地址为IP(基于sslip.io)(默认关闭此功能)

可用示例:[https://cf.131.re/](https://cf.131.re/)
4 changes: 2 additions & 2 deletions cf.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ public function update_record($zone_name,$record){
$at=$record["@"];
unset($record["@"]);
if ((Enable_A_Record) && (filter_var($at,FILTER_VALIDATE_IP,FILTER_FLAG_IPV4))){
$at=$at.'.xip.io';
$at=$at.'.sslip.io';
}
$str="";
foreach ($record as $key => $value){
if ((Enable_A_Record) && (filter_var($value,FILTER_VALIDATE_IP,FILTER_FLAG_IPV4))){
$str.=$key.":".$value.".xip.io,";
$str.=$key.":".$value.".sslip.io,";
}else{
$str.=$key.":".$value.",";
}
Expand Down
2 changes: 1 addition & 1 deletion config.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
define("reCAPTCHA_Site","");
define("reCAPTCHA_Secret","");

//A记录解析(基于xip.io)
//A记录解析(基于sslip.io)
define("Enable_A_Record",false);
4 changes: 2 additions & 2 deletions manage_domain.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ function msg($s){
{
$is_ssl=true;
}
if ((Enable_A_Record) && (filter_var(str_replace('.xip.io','',$set),FILTER_VALIDATE_IP,FILTER_FLAG_IPV4))){
$set=str_replace('.xip.io','',$set);
if ((Enable_A_Record) && (filter_var(str_replace('.sslip.io','',$set),FILTER_VALIDATE_IP,FILTER_FLAG_IPV4))){
$set=str_replace('.sslip.io','',$set);
}
echo "<tr>".
'<td><button style="display:inline;" class="mdui-btn mdui-btn-icon mdui-shadow-3 ';
Expand Down

0 comments on commit 0b406a9

Please sign in to comment.