答案很簡單。雖然它是代理服務,但並不保證100%匿名。當你通過代理服務器發送HTTP GET請求,你的程序發送到代理服務器的請求是:
GET http://www.whatsmybrowser.org/ HTTP/1.1
Host: www.whatsmybrowser.org
Connection: keep-alive
Accept-Encoding: gzip, deflate
Accept: */*
User-Agent: python-requests/2.10.0
現在,當代理服務器發送該請求到實際目的地,它將:
GET http://www.whatsmybrowser.org/ HTTP/1.1
Host: www.whatsmybrowser.org
Accept-Encoding: gzip, deflate
Accept: */*
User-Agent: python-requests/2.10.0
Via: 1.1 naxserver (squid/3.1.8)
X-Forwarded-For: 122.126.64.43
Cache-Control: max-age=18000
Connection: keep-alive
正如你所看到的,它會引發你的IP(在我的情況,122.126.64.43
)在HTTP標頭:X-Forwarded-For
,因此該網站知道該請求是代表122.126.64.43
瞭解更多關於這個^ h發送EADER在:https://tools.ietf.org/html/rfc7239
如果你想舉辦自己的Squid代理服務器,並希望禁止設置X-Forwarded-For
標題,寫着:http://www.squid-cache.org/Doc/config/forwarded_for/