mirror of
https://github.com/System-End/ip.git
synced 2026-04-19 16:28:23 +00:00
Use x-real-ip header
This commit is contained in:
parent
8e9b9eda40
commit
e74617949b
1 changed files with 1 additions and 1 deletions
2
index.ts
2
index.ts
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue