You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi I am writing an application in node.js and I need the client ip address to identify from which client the hit came. I need both ipv4 and ipv6 adderess. Is there any way in node.js to get both addresses ?
The text was updated successfully, but these errors were encountered:
These kinds of questions are better suited for the nodejs/help repo. This repo is for issues about node core itself.
The answer to your question though is that you use req.socket.address().address to get the IP and req.socket.address().family to get the address family ('IPv4' or 'IPv6'). You cannot get both types of addresses since in general all IP network connections are made using either one or the other type.
Hi I am writing an application in node.js and I need the client ip address to identify from which client the hit came. I need both ipv4 and ipv6 adderess. Is there any way in node.js to get both addresses ?
The text was updated successfully, but these errors were encountered: