-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose IP and port of connected peers #97
Comments
Reference for those unfamiliar with private network space (I've had so many problems when these networks collide within an organization): https://datatracker.ietf.org/doc/html/rfc1918 |
We already know internally if it's a local connection, so we should prob bubble that up additionally vs just the ip - the ip is fine as well, but a user shouldn't be required to analyse that i think. |
@mafintosh - I haven't looked at the v3 code as much be in v2 didn't it consider a loopback IP address local? |
For our use-case, just knowing if it is a local connection would be all the information we need. We don't need the IP. |
@smoyer64 it uses this https://github.com/mafintosh/bogon/blob/master/index.js to map how to holepunch to people |
Tracking issue here: holepunchto/hyperdht#76 |
Currently neither the
socket
orpeerInfo
objects returned fromswarm.on('connection')
expose the IP or port of the connected peer. This is a feature request to expose this information.Our use-case is to use to IP to determine if the peer is local (e.g. if the IP is in a private range 10.0.0.0, 172.16.0.0, 192.168.0.0).
It would also be really great to expose this to
opts.firewall
, so that we could auto-reject non-local connections if we want to ensure that nothing connects online.@mafintosh
The text was updated successfully, but these errors were encountered: