note: 判斷 client 是否經由 proxy 連過來

2011021021:44
<?
echo 'REMOTE_ADDR='.$_SERVER['REMOTE_ADDR'];
echo "<br>";

echo 'HTTP_VIA='.$_SERVER['HTTP_VIA'];
echo "<br>";

echo 'HTTP_X_FORWARDED_FOR='.$_SERVER['HTTP_X_FORWARDED_FOR'];
?>

結果︰
REMOTE_ADDR=61.219.36.186
HTTP_VIA=1.1 sys1-p1-186:8100 (squid/2.7.STABLE9)
HTTP_X_FORWARDED_FOR=114.44.124.12

Squid 設定中可以隱藏這些資訊

squid.conf  設定

#避免 squid 送出 Via
header_access Via deny all

#避免 squid 送出 X-Forwarded-For
header_access X-Forwarded-For deny all