PxPlus User Forum

Twitter Twitter Twitter

Author Topic: BROWSER IP ADDRESS  (Read 1933 times)

suriakumar

  • Member
  • **
  • Posts: 5
    • 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

  • Diamond Member
  • *****
  • Posts: 129
    • 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

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
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 »
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

suriakumar

  • Member
  • **
  • Posts: 5
    • 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

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
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.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

mike motz

  • New Member
  • *
  • Posts: 4
    • View Profile
    • Pickleball Game Scheduling
Re: BROWSER IP ADDRESS
« Reply #5 on: April 21, 2021, 08:23:52 PM »
when debugging web issues use a line like,  FLOUT=%FLOUT; IF FLOUT<>0 THEN DUMP (FLOUT)*
after you opened the file and set %FLOUT to the channel number of the file you just created.
my dump has it as twice ... REMOTE_ADDR=76.68.62.122 and %remote_ip$="76.68.62.122"
You'll see any variable that is available in memory.