NuxtN
Nuxt3y ago
12 replies
Vex

Getting the client's IP address in a Nuxt 3 /server/api context

Hi, I'm trying to obtain the IP address of the Client in an API endpoint within Nuxt 3, I've tried:
event.node.req.headers['x-real-ip'];
event.node.req.socket.remoteAddress;
event.node.req.connection.remoteAddress;

But none seem to provide the value, am I missing something?
Was this page helpful?