R
Railway9mo ago
iQuick

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:
iQuick, please see the "request headers" section of this docs page https://docs.railway.app/reference/public-networking
Jump to solution
17 Replies
Percy
Percy9mo ago
Project ID: N/A
iQuick
iQuickOP9mo ago
okay i'll try that one
Brody
Brody9mo ago
nope
maddsua
maddsua9mo ago
what nope lol that's what railway's proxy sets
Brody
Brody9mo ago
not for long
Solution
Brody
Brody9mo ago
iQuick, please see the "request headers" section of this docs page https://docs.railway.app/reference/public-networking
maddsua
maddsua9mo ago
some of those were spoofable, weren't they?
Brody
Brody9mo ago
read the right most value railway is not going to be using envoy forever
maddsua
maddsua9mo ago
ok, true, but there was a problem with clients being able to just set arbitrary value to X-Forwarded-For
Brody
Brody9mo ago
^
maddsua
maddsua9mo ago
I didn't see any updates that it was fixed bruh it should be overwritten, not appended anyway, I'm out then
iQuick
iQuickOP9mo ago
so uh it can be spoofed
Brody
Brody9mo ago
^
iQuick
iQuickOP9mo ago
i'd say the right one is X-Forwarded-For i just need the remote ip
Brody
Brody9mo ago
read the right most value from that header and you will get the remote ip
iQuick
iQuickOP9mo ago
ok thanks it works, thank you
Brody
Brody9mo ago
no problem
Want results from more Discord servers?
Add your server