obtaining external ip address from docker container

Anonymous
TRIAL

a year ago

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

Solved

0 Replies

maddsua
HOBBY

a year ago

Check "x-envoy-external-address" request header for it


Anonymous
TRIAL

a year ago

okay


Anonymous
TRIAL

a year ago

i'll try that one


a year ago

nope


maddsua
HOBBY

a year ago

what nope lol


maddsua
HOBBY

a year ago

that's what railway's proxy sets


a year ago

not for long


a year ago

please see the "request headers" section of this docs page

https://docs.railway.app/reference/public-networking


Status changed to Solved Railway over 1 year ago


maddsua
HOBBY

a year ago

some of those were spoofable, weren't they?


a year ago

read the right most value


a year ago

railway is not going to be using envoy forever


maddsua
HOBBY

a year ago

ok, true, but there was a problem with clients being able to just set arbitrary value to X-Forwarded-For


a year ago

^


maddsua
HOBBY

a year ago

I didn't see any updates that it was fixed


maddsua
HOBBY

a year ago

bruh


maddsua
HOBBY

a year ago

it should be overwritten, not appended


maddsua
HOBBY

a year ago

anyway, I'm out then


Anonymous
TRIAL

a year ago

so uh


Anonymous
TRIAL

a year ago

it can be spoofed


a year ago

^


Anonymous
TRIAL

a year ago

i'd say the right one is X-Forwarded-For


Anonymous
TRIAL

a year ago

i just need the remote ip


a year ago

read the right most value from that header and you will get the remote ip


Anonymous
TRIAL

a year ago

ok thanks


Anonymous
TRIAL

a year ago

it works, thank you


a year ago

no problem