skip to Main Content

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

2

Answers


  1. 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

    Login or Signup to reply.
  2. Use this to get the IP address

    let ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search