get IP from the real ip header

master
Kuba Orlik 2 years ago
parent eb1f25debf
commit e47e2db5a0

@ -48,7 +48,7 @@ router.get("/card", async (ctx) => {
const tracks = []; const tracks = [];
router.get("/track", async (ctx) => { router.get("/track", async (ctx) => {
const ISP = await getISP(ctx.request.ip); const ISP = await getISP(ctx.headers["x-real-ip"] || ctx.request.ip);
tracks.push({ ...ctx.query, ip: ctx.request.ip, ISP }); tracks.push({ ...ctx.query, ip: ctx.request.ip, ISP });
}); });

Loading…
Cancel
Save