#Get IP of incoming HTTP request
40 messages · Page 1 of 1 (latest)
Project ID: N/A
N/A
X-Forwarded-For
https://utilities.up.railway.app/raw
cool thanks
no problem!
@pine swan 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
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.
fiber 💀
💀
Also it's faster than Gin.
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
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
app := fiber.New(fiber.Config{
ProxyHeader: fiber.HeaderXForwardedFor,
})
thats how its done with fiber
I just did this.
c.Get("X-Forwarded-For")
perfect
oh not perfect
Fixed.