PxPlus User Forum

Twitter Twitter Twitter

Author Topic: BROWSER IP ADDRESS  (Read 167 times)

suriakumar

  • New Member
  • *
  • Posts: 3
    • View Profile
BROWSER IP ADDRESS
« on: February 16, 2021, 01:05:25 AM »
Sir,

I want to get the browser's IP Address.  The Global variable %REMOTE_IP$ does not work.  It contains server's ip address.  It does not contain Browser's IP Address.   Please inform me how to get the Browser's IP address through PXPLUS

michaelgreer

  • Gold Member
  • ****
  • Posts: 55
    • View Profile
Re: BROWSER IP ADDRESS
« Reply #1 on: February 16, 2021, 08:50:04 AM »
In every application I have build using the webserver %remote_ip$ is always the browser/remote ip address.  In fact, I have used that as part of a "firewall" scheme to lock down access.

Mike King

  • Administrator
  • Diamond Member
  • *****
  • Posts: 3403
  • Mike King
    • View Profile
    • PVX Plus Technologies
Re: BROWSER IP ADDRESS
« Reply #2 on: February 16, 2021, 09:10:03 AM »
Is it possible that you have a proxy forwarder on your site? 

Basically the %REMOTE_IP$ is the IP address at the other end of the connection which normally is the browser, but if your request are being routed through a proxy server, load balancer, VPN, or similar it will reflect the address of the server doing the redirection.

In most cases these servers will insert the true originating IP address in the request header thus in one of the global variables we provide.  Typically, although not a 100% approved standard, the originating IP address will be found in %X_Forwarded_For$ which comes from the X-Forwarded-For request header.
« Last Edit: February 16, 2021, 10:36:12 PM by Mike King »

suriakumar

  • New Member
  • *
  • Posts: 3
    • View Profile
Re: BROWSER IP ADDRESS
« Reply #3 on: February 17, 2021, 05:48:05 AM »
Sir,

In Which VERSION of pxplus you have the global variable %X_FORWARDED_FOR$ ?. I am using PXPLUS version 11.65.   This variable is not available in this Version.    The WEB SERVER Version is 1.3.17.  Or In case if you have introduced in your latest version of web server please inform me the WEB SERVER Version

J.SURIAKUMAR
« Last Edit: February 17, 2021, 06:36:20 AM by suriakumar »

Mike King

  • Administrator
  • Diamond Member
  • *****
  • Posts: 3403
  • Mike King
    • View Profile
    • PVX Plus Technologies
Re: BROWSER IP ADDRESS
« Reply #4 on: February 17, 2021, 02:41:11 PM »
When the PxPlus web server runs your application it converts all HTTP request headers into global variables.

If %X_Forwarded_For$ is not set then there was no X-Forwarded-for: header in the HTTP request.  There may however be a %Forwarded$ header.

Here are some details on this header: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For

It is also quite possible that your server may not provide the original workstations IP address.  This is not uncommon as the IP address provides a means to help identify the user which may or may not be desirable.