深圳全飞鸿

标题: VPN项目用到的CRC功能介绍 [打印本页]

作者: zhgc    时间: 2019-10-18 00:28
标题: VPN项目用到的CRC功能介绍
VPN项目用到的CRC功能介绍


看VPN系统中的引用代码 :

  1. function crc_send($msg,$who="温总2019项目"){
  2.         $myip=$this->crc_ip;
  3.         $port=$this->crc_port;
  4.         $data=array();
  5.         $data["tag"]=418;  //数据完整性检查
  6.         $data["a"]=$msg;
  7.         $data["b"]=$who;
  8.         $msg=json_encode($data,JSON_UNESCAPED_UNICODE);
  9.         $msg=base64_encode($msg);
  10.         $url="http://{$myip}:{$port}/crc/rfc.php?id=0&t=".$this->get_tick()."&m={$msg}";
  11.         //echo $url;
  12.         $tmp=$this->file_get_contents_by_curl($url);
  13.         if($tmp=="OK"){
  14.                 $_SESSION['myip']=$myip;
  15.                 $_SESSION['myport']=$port;
  16.         };       
  17. }
复制代码



1. 内容为UTF8
2. URL中有加id=0来控制action






欢迎光临 深圳全飞鸿 (http://www.nagomes.com/disc/) Powered by Discuz! X3.2