I have a nodeJS web service in based on feathersjs and feathers-socket.io I need to know ip address of my clients in hook before. How can I do it?
Asked
Active
Viewed 249 times
0
-
Answered here. https://stackoverflow.com/questions/6458083/get-the-clients-ip-address-in-socket-io – Tom Shaw Dec 29 '19 at 20:08
-
I need to have ip address in feathersjs hook before. – SeaDog Dec 29 '19 at 20:19
-
you can use this module as a middleware https://www.npmjs.com/package/request-ip – C.Gochev Dec 29 '19 at 22:00
-
I added req.feathers.ip = req.ip to a middleware but it wasn't work. In other hand I use feathers-socket.io and I not see anything about IP in obj socket too. I used finally jquery get method $.getJSON getting ip address from jsonip.com and added it to params.query. – SeaDog Dec 30 '19 at 17:09