obtaining external ip address from docker container
I have deployed my app using docker on Railway, my app takes the external ip address from the requests it gets and needs to save them to a database. However when saving the address it's a private IP address and that's not what i want
Solution:Jump to solution
iQuick, please see the "request headers" section of this docs page https://docs.railway.app/reference/public-networking
17 Replies
Project ID:
N/A
okay
i'll try that one
nope
what nope lol
that's what railway's proxy sets
not for long
Solution
iQuick, please see the "request headers" section of this docs page https://docs.railway.app/reference/public-networking
some of those were spoofable, weren't they?
read the right most value
railway is not going to be using envoy forever
ok, true, but there was a problem with clients being able to just set arbitrary value to
X-Forwarded-For
^
I didn't see any updates that it was fixed
bruh
it should be overwritten, not appended
anyway, I'm out then
so uh
it can be spoofed
^
i'd say the right one is X-Forwarded-For
i just need the remote ip
read the right most value from that header and you will get the remote ip
ok thanks
it works, thank you
no problem