Get IP of incoming HTTP request
Is there a way to get incoming HTTP requests? Attempting to get the IP results in the IP of the railway proxy being returned. Is there a header or something I can grab?
28 Replies
Project ID:
N/A
N/A
cool thanks
no problem!
@Brody Do you know if using a cloudflare proxy affects this?
if you use a custom domain with a cloudflare proxy, you will now get a cloudflare IP as the A type, and i am pretty sure thats still not a static ip
Railway doesn't replicate the X-Forwarded-For header from Cloudflare?
Shame.
really? railways proxy doesn't pass cloudflare's
X-Forwarded-For
header through to its own X-Forwarded-For
header?Testing that now.
Nevermind. It indeed does.
FemboyCDN
FemboyCDN is a free image hosting service.
fiber π
I love Fiber.
I like the Express feel.
π
Also it's faster than Gin.
stdlib is faster than gin
gin is bloat
Which is why I use Fiber.
just dont try to send or receive large files
What happens then?
by default fasthttp will buffer it into memory
sometimes even doublebuffer
want to send a 100mb file to a client? well now your mem usage just increased 200mb
Fun.
Good thing I cap my files at 10mb.
i even speed limit uploads and downloads from the apis, theres no need for that dude with 10gig fiber internet to sap up all the bandwidth
Haha.
so all good now?
fiber has a real ip middleware right
thats how its done with fiber
I just did this.
c.Get("X-Forwarded-For")
perfect
oh not perfect
Fixed.
do this, then you can just do
c.IP()
in a handler