Getting User's IP on request
cicerorph
HOBBYOP

a year ago

I'm trying to get the user's IP for ratelimiting, but all request are coming from one ip even tho there's alot of users using it (all around the globe).

I'm using express.

I'm first checking for "x-real-ip" then "cf-connecting-ip" then req.ip

I have trust proxy as true

Is there any header that railway provides to get the connection ip?

Solved$10 Bounty

7 Replies

cicerorph
HOBBYOP

a year ago

1cb25001-9d85-4c83-905e-0d3764a05899]


a year ago

This might be helpful to you


a year ago

X-Forwarded-For should contain what you need, the first IP there should be the user's IP address


a year ago

heads up btw if you're using cloudflare then you need to use Cloudflare's IP forwarding header


cicerorph
HOBBYOP

a year ago

im using cloudflare, but im not using their proxy


a year ago

oh alright


a year ago

!s


Status changed to Solved dev 11 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...