I wrote the code of ASP to take the real IP, and there is no agent, first or multi -level agent with environmental testing. You can get it normally
Function Checkip (Checkstring) 'Use regularly to determine whether IP is legal
Dim Re1
set re1 = New Regexp
Re1.pattern =^[0-9] {1,3}. [0-9] {1,3}. [0-9] {1,3}. [0-9] {1,3} $
Re1.global = false
Re1.ignorecase = false
Checkip = Re1.test (Checkstring)
set re1 = Nothing
end function
Function get_cli_ip () 'to take the real IP function, first http_client_ip and then http_x_Forwardeded_FOR and then remote_addr
dim client_ip
if Checkip (request.servervariables (http_client_ip)) = true then
get_cli_ip = Checkip (request.servervariables (http_client_ip))
else
Myarray = split (request.servervariables (http_x_Forwarded_FOR) ,,)
if ubound (MyARRAY)> = 0 THEN
client_ip = trim (MyArray (0))
if checkip (client_ip) = true then
get_cli_ip = client_ip
exit function
end if
end if
get_cli_ip = request.servervariables (remote_addr)
end if
end function