Search code examples
javascriptnode.jsexpresshttpip-address

How Express handles client IP change?


As the title says, i don't know how Express handles client IP when this is changing (for example the cause may be that the client is moved away from his original network). Also, i would like to know if when executing a request in network A, the value of req.ip is the same if I had made the same request in network B after i moved here and, if it should be different, if Express interprets it as if the request had been sent from the same origin. Hope this sounds clear. Thank you in advance for all the support.

UPDATE

Here is a example in order to better understand the problem:

let's pretend that I have sent a request from my smartphone to the nodejs server through network A and then I execute the same request from the same smartphone but through network B (thus changing IP address). The question is, when my nodejs server gets the second request, will the server say something like "hey this request comes from the same device"?


Solution

  • The question is, when my nodejs server gets the second request, will the server say something like "hey this request comes from the same device"?

    No.

    The requests are independant.