Home > Software design >  Unable to find request IP address when port forwarding
Unable to find request IP address when port forwarding

Time:06-27

Unable to find request IP address when port forwarding

Example :

My Laptop Call > Jump Server Call >> The Web Server

At the Web Server the request ip will be every time the jump server ip

How to know the real ip that is call the Web Server in my case is My laptop not the Jump Server

CodePudding user response:

If your jump server acts as a proxy you might want to check to X-FORWARDED-FOR header.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For

CodePudding user response:

Use this to get the IP address

let ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress
  • Related