Get IP of user using trpc?

is it possible to just get the ip of the user using trpc without just including it in the input?
Solution:
req.headers['x-forwarded-for']
Jump to solution
4 Replies
Solution
barry
barry3y ago
req.headers['x-forwarded-for']
barry
barry3y ago
req.ip req.connection.remoteAddress Are the most common ways
lonelil
lonelilOP3y ago
i dont think trpc provides the request object, could you show an example?
barry
barry3y ago
It does Gotta go to your trpc file where the context is And pass it in yourself

Did you find this page helpful?