metcoder95 / fastify-ip

Infer the Request IP (or IPs if behind a proxy) based on custom headers
MIT License
7 stars 0 forks source link

not work at all #44

Open GVALFER opened 1 month ago

GVALFER commented 1 month ago

Describe the bug This simple plugin does not work at all

import fastifyIp from "fastify-ip";
app.register(fastifyIp);

app.get("/ip", async (req, reply) => {
  return { ip: req.ip };
});

console log print
{"ip":""}

Any suggestion?

metcoder95 commented 1 month ago

Can you provide an Minimum Reproducible Example?

A quick guess its that the ip of your request might not be populated from the request itself, not from within the plugin.