You can get these information with the help of below three server variables.
REMOTE_ADDR
HTTP_VIA
HTTP_X_FORWARDED_FOR
When any user visit your site without any proxy server in that case you can get the IP address using REMOTE_ADDR server variable. So in that case HTTP_X_FORWARDED_FOR and HTTP_VIA will not be available.
Note: HTTP_VIA and HTTP_X_FORWARDED_FOR will be only populated if web server detects the use of the Proxy Server.
Now for understanding the HTTP_VIA and HTTP_X_FORWARDED_FOR check the below scenario:
Suppose any user from India visits my site from the proxy server of the USA. Below I have listed the user’s flow with dummy IP addresses.
User( India 1.25.32.51 ) >> Proxy (USA 54.58.210.255) >> http://www.xpertdeveloper.com
Read more: XPert developer
QR: