深圳全飞鸿
标题:
VPN项目用到的CRC功能介绍
[打印本页]
作者:
zhgc
时间:
2019-10-18 00:28
标题:
VPN项目用到的CRC功能介绍
VPN项目用到的CRC功能介绍
看VPN系统中的引用代码 :
function crc_send($msg,$who="温总2019项目"){
$myip=$this->crc_ip;
$port=$this->crc_port;
$data=array();
$data["tag"]=418; //数据完整性检查
$data["a"]=$msg;
$data["b"]=$who;
$msg=json_encode($data,JSON_UNESCAPED_UNICODE);
$msg=base64_encode($msg);
$url="http://{$myip}:{$port}/crc/rfc.php?id=0&t=".$this->get_tick()."&m={$msg}";
//echo $url;
$tmp=$this->file_get_contents_by_curl($url);
if($tmp=="OK"){
$_SESSION['myip']=$myip;
$_SESSION['myport']=$port;
};
}
复制代码
1. 内容为UTF8
2. URL中有加id=0来控制action
欢迎光临 深圳全飞鸿 (http://www.nagomes.com/disc/)
Powered by Discuz! X3.2