Question sjbttt sjbttt · Jan 21, 2019

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

Eduard Lebedyuk · Jan 21, 2019

Looks like NAT. Cloud server only sees external address (214.17.17) as it should.

Why do you want to get internal address?

0
sjbttt sjbttt  Jan 21, 2019 to Eduard Lebedyuk

Because I want to manage the client through information such as IP address.

0
Eduard Lebedyuk  Jan 21, 2019 to sjbttt sjbttt

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?

0
sjbttt sjbttt  Jan 22, 2019 to Eduard Lebedyuk

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.

0
sjbttt sjbttt  Apr 8, 2020 to Thembelani Mlalazi

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

0