How does a server actually identify the requesting client address (IP), and send a response? Is it possible to get the IP address of requesting client in GAE?
To obtain the IP address of users on your original servers, we have added two HTTP headers to requests to your server: X-Forwarded-For ou True-Client-IP. The X-Forwarded-For header is a list of IP addresses that forwarded the request. The first IP address is the IP address of the browser.
After the client establishes a successful connection to the server, the IP address of the client will be printed on the server console.
Use an IP lookup tool Starting with the simplest way to find someone's IP address is to use one of the many IP lookup tools available online. Resources such as WhatIsMyIPAddress.com or WhatIsMyIP.com offer tools to enter an IP address and search for its free public registry results.
Client IP addresses describe only the computer being used, not the user. If multiple users share the same computer, they will be indistinguishable. Many Internet service providers dynamically assign IP addresses to users when they log in.
In a Java servlet you could use request.getRemoteAddr()
:
public void doGet(HttpServletRequest req, HttpServletResponse resp) {
String ipAddress = req.getRemoteAddr();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With