How can I get the real IP Address?
My database service is on the cloud server, and I access it on the company intranet. When I user the %request.CgiEnvs to get "REMOTE_ADDR", but what I have been getting is the company's external address. I can't get my IP address in the LAN.
For example, my computer IP address is 192.168.11.11, and my company's external public network address is 214.17.17. I can only get 214.17.17 by using %request.CgiEnvs("REMOTE_ADDR"), but not 192.168.11.11.
I only want to get 192.168.11.11.
Any help would be appreciated. Thanks!
Comments
Looks like NAT. Cloud server only sees external address (214.17.17) as it should.
Why do you want to get internal address?
Because I want to manage the client through information such as IP address.
If you want, you can pass current IP as a header or inside the message body.
Do you want it for logging purposes, such as what actions were performed from which IP?
Yes, I want to record what actions were performed from which IP. The reason I wanted to find the answer at %Request was because I was bothered by another question. My application is B/S structure, the front-end is implemented by React, and the method of getting local IP address by Javascripts is incompatible with IE, Chrome, Firefox and so on. Because Chrome is not compatible with ActiveX. If I can, I want to get the IP address in a unified way, compatible with the browsers above.
@sjbttt sjbttt did you final get the solution to this if you did would you kindly share the solution please
2 solutions,1、use WCF provide resident local service for front-end call to obtain real local IP;2、encapsulate a browser provided method for the front end to call; In fact, I used both, in different ways in different scenes