Home > Back-end >  How to get from an ajax request for the client to customer DuanGong network IP address?
How to get from an ajax request for the client to customer DuanGong network IP address?

Time:02-18

Built a tomcat service, hope in the client side through HTTP calls, access to the client the real public IP addresses,

Current Client calls request, the server side by the request. The getHeader (" X-ray forwarded - for ") getHeader (" Proxy - the Client - IP ") getHeader (" WL - Proxy - the Client - IP ") getRemoteAddr () methods are tried, are generally taken 127 or 192, doesn't really want to address, such as 124.128.77. *,

Access to this web site http://ip.chinaz.com/, will be able to return to the client's IP address, don't know how to implement,

Don't tell me to let the client to access the site, crawl real IP, this method is feasible, but is not stable, stop taking just over one thousand web site,

Is there a way to more insurance for client side public IP? Thank you,

CodePudding user response:

Access to the address is 127 or 192, etc., the client and the server you are is the machine or the same local area network (LAN)

CodePudding user response:

reference 1st floor asdfv63 response:
access to the address is 127 or 192, etc., is it in your server is the client and the machine or the same local area network (LAN)

Other machine has access to the machine is 127 20.10 section is wrong because went to the American - 20.10 positioning must obtain or have a problem

CodePudding user response:

If it is a public network access server, got the network segment address, you can use this machine to you send http://ip.chinaz.com/, here to check on it, because of some foreign IP dial-up Internet distribution exist, especially that of the Great Wall broadband
  • Related