Open gmaclennan opened 2 years ago
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?
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.
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: https://github.com/hyperswarm/dht/issues/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