當你瀏覽網頁(如whatismyip.com),您的計算機通知有關你的IP地址的服務器,使服務器可以送你回去的HTML,圖形和其他元素您請求的網頁。
考慮下列服務器變量(C#代碼):
string server = Request.ServerVariables["SERVER_NAME"];
string url = Request.ServerVariables["URL"];
querystring = Request.ServerVariables["QUERY_STRING"];
string ipAddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (ipAddress == null || ipAddress == "")
{
ipAddress = Request.ServerVariables["REMOTE_ADDR"];
}
以下是一些其他變量:
"HTTP_X_COMING_FROM"
"HTTP_X_FORWARDED_FOR"
"HTTP_X_FORWARDED"
"HTTP_X_REAL_IP"
"HTTP_VIA"
"HTTP_COMING_FROM"
"HTTP_FORWARDED_FOR"
"HTTP_FORWARDED"
"HTTP_FROM"
"HTTP_PROXY_CONNECTION"
"CLIENT_IP"
"FORWARDED"
來源
2012-10-04 13:09:15
mrd
可能在魷魚的X轉發,對於選項 –