holepunchto / hyperdht

The DHT powering Hyperswarm
https://docs.holepunch.to
MIT License
332 stars 49 forks source link

Add userData to handshake #57

Open pfrazee opened 3 years ago

pfrazee commented 3 years ago

Maf mentioned the potential to include userData in the handshake. I'd personally like to use that to declare the intended protocol so that I don't have to go sniffing packets.

lanmower commented 2 years ago

Me likey

OzymandiasTheGreat commented 2 years ago

I've been hacking on the DHT and this seems simple enough to do. One question tho @mafintosh where should userData be set? I think it'd be a good idea to set it on the server constructor and connect() call, that way we can have e.g. custom firewall logic based on userData. If you clarify this, I'll make a PR.