T
TanStack•6mo ago
genetic-orange

Request object - IP address?

How to get client IP address from an API Route (or a ServerFn)? The usual objects like .socket aren't present.
2 Replies
gradual-turquoise
gradual-turquoise•6mo ago
does this work?
const event = getEvent()
const request = event.node.req
request.ip
const event = getEvent()
const request = event.node.req
request.ip
genetic-orange
genetic-orangeOP•6mo ago
almost - .socket.remoteAddress is available. I think this works! Thanks 🙂

Did you find this page helpful?