From 424ba767646a8764babf0c4d201be2702375e95a Mon Sep 17 00:00:00 2001 From: firesun Date: Sat, 31 Oct 2015 14:32:22 +0800 Subject: [PATCH] =?UTF-8?q?Version=202.3.1=20keepsession=E6=97=B6=E4=BC=AA?= =?UTF-8?q?=E9=80=A0ip=E8=AE=BF=E9=97=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- keepsession.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/keepsession.php b/keepsession.php index 9f0525a..a28f2d0 100644 --- a/keepsession.php +++ b/keepsession.php @@ -31,17 +31,21 @@ if(KEEP_SESSION) if(isset($info['headers_data']['User-Agent'])) $useragent=$info['headers_data']['User-Agent']; + $ip=$info['user_IP']; if($url!="" && $cookie!="") { $ch = curl_init(); $header[]= 'User-Agent: '.$useragent; $header[]= 'Cookie: '.$cookie; + $header[]= 'X-Forwarded-For: '.$ip; + curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_HTTPHEADER,$header); curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1); curl_setopt($ch, CURLOPT_TIMEOUT,10); //https不校验证书,按需开启吧 //curl_setopt ( $curl_handle, CURLOPT_SSL_VERIFYHOST, 0 ); + curl_exec($ch); curl_close($ch); }