I have done a Java backed webscript in Alfresco.
In this webscript I want to get remote ip address.
System.out.println("L'objet httpRequest n'est pas null");
ipAdress = httpRequest.getRemoteHost();
But ip address always returns 127.0.0.1.
The webscript is hosted in tomcat\webapps\alfresco\WEB-INF\lib and its declaration in the file \tomcat\webapps\alfresco\WEB-INF\classes\alfresco\web-client-application-context.xml
Have I missed something?
Related
For a machine with multiple IP addresses and has a hostname, how does the WMI remote query choose which IP address to connect to? I know that if we set the IP address of a machine in "hosts" file, the ping command will resolve to that IP address.
The reason I have this question is because one of the proprietary app
that I used had WMI query to get remote info, but it used different IP
to connect to the target machine than the one supplied in "hosts"
file.
I have a network with a resource with an internal ip of 192.168.1.254 for example. I need to be able to access this resource from the external IP address of 86.126.1.234 let's say. I am off site and need to use VNC to access this computer.
How can I access this resource using just the two IP addresses.
Thanks in advance,
Maksim
192.168. is a non routable ip address.
You need an external facing ip address.
to find out your external ip address you can try
whatsmyipaddress.com
You will probably need to change your router configuration to make your VNC port forwarded to 192.168.1.254.
Or, you if you just need remote control access to your Computer, try using
www.teamviewer.com
I have a Compute Engine instance running with a static external IP address assigned to it, running
gcloud compute instances list
Shows me indeed the instance and the appropriate external IP address.
I would have thought that visiting that IP address in the browser would show my application?
I have enabled Firewall Rules to the network:
0.0.0.0/0 tcp:80; tcp:443; tcp:9000; tcp:23
I am asking, because I am trying to point my custom domain name to my app, so I have set my A record with my domain registrar to the external IP.
How can I view my app via my external IP address in the browser, is it possible?
I need the client IP address to find the client location so that I could list the details of that area to he client. I used this code to find the IP address.
$this->container->get('request')->getClientIp();
But I'm getting the IP as 127.0.0.1.
How can I get the client IP address? Can someone give me a complete working code?
It's 127.0.0.1 because your server is installed on your machine (I guess).
But $request->getClientIp() is the right way to get the user ip.
For the geolocation, I suggest you to take a look at the geocoder library and his bundle.
I want to get ip address of client machine Like I opened website on my machine which is hosted on any server So i need IP address of my machine not hosted server IP.
HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]
use above syntax in C# otherwise you will get error like Non-invocable member 'System.Web.HttpRequest.ServerVariables' cannot be used like a method.
''# VB
HttpContext.Current.Request.ServerVariables("REMOTE_ADDR")
// C#
HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]
This will get the PUBLIC ip address of the client computer. It will NOT get the LAN IP (192.168...)