How do I access my user's public IP?
I'm using a FastAPI as the backend for our app, and have migrated it from our VPS to Railway a few days ago.
I noticed that this line of code, isn't returning the client's Public IP anymore, and is instead returning IPs in the range 192.168.0.X:
How do I fix it?
Project ID: 9104e677-99c1-48c6-bbe8-41942e8c5fa2
Solution:Jump to solution
your app sits behind a proxy when on railway, the clients ip can be found by trusting the
X-Envoy-External-Address
header
https://utilities.up.railway.app/raw...5 Replies
Project ID:
9104e677-99c1-48c6-bbe8-41942e8c5fa2
9104e677-99c1-48c6-bbe8-41942e8c5fa2
Solution
your app sits behind a proxy when on railway, the clients ip can be found by trusting the
X-Envoy-External-Address
header
https://utilities.up.railway.app/rawGot it, I'll check it it. Thanks Brody!
Does railway's proxy automatically mitigate DDOS attacks? Or is it recommended to have Cloudflare still handle that?
railway does not advertise ddos protection, if thats a concern youd want to use cloudflare
cloudflare has their own header for the client ip
https://developers.cloudflare.com/fundamentals/reference/http-request-headers/#cf-connecting-ip