Cannot get user IP address (proxy/firewall/load balancer)
问题 I used code below to get client ip with asp.net before but after I moved to VDS this function begin returning only my subnet mask which is 178.18.198.1 or 178.18.198.2. Can anyone help me with this problem? Private Function GetIPAddress() As String Dim sIPAddress As String = Nothing sIPAddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR") If String.IsNullOrEmpty(sIPAddress) Then sIPAddress = Request.ServerVariables("REMOTE_ADDR") End If Return sIPAddress End Function EDIT Found similar