obtaining external ip address from docker container

AnonymousTRIAL

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

maddsuaHOBBY

a year ago

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


AnonymousTRIAL

a year ago

okay


AnonymousTRIAL

a year ago

i'll try that one


a year ago

nope


maddsuaHOBBY

a year ago

what nope lol


maddsuaHOBBY

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[bot] about 1 year ago


maddsuaHOBBY

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


maddsuaHOBBY

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

^


maddsuaHOBBY

a year ago

I didn't see any updates that it was fixed


maddsuaHOBBY

a year ago

bruh


maddsuaHOBBY

a year ago

it should be overwritten, not appended


maddsuaHOBBY

a year ago

anyway, I'm out then


AnonymousTRIAL

a year ago

so uh


AnonymousTRIAL

a year ago

it can be spoofed


a year ago

^


AnonymousTRIAL

a year ago

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


AnonymousTRIAL

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


AnonymousTRIAL

a year ago

ok thanks


AnonymousTRIAL

a year ago

it works, thank you


a year ago

no problem