Use x-real-ip header

This commit is contained in:
Malted 2025-03-30 17:56:29 -04:00
parent 8e9b9eda40
commit e74617949b
No known key found for this signature in database

View file

@ -40,7 +40,7 @@ Bun.serve({
routes: {
"/ip": async (req, server) => {
const start = performance.now()
const ip = server.requestIP(req)
const ip = req.headers.get("x-real-ip")
console.log({ip, req})
const [ipRes] = await q(ip.address)
console.log(Math.round(performance.now() - start) + " ms")