nervosnetwork / tentacle

A multiplexed p2p network framework that supports custom protocols
https://docs.rs/tentacle
MIT License
54 stars 24 forks source link

Support `Onion3` Protocol #374

Open eval-exec opened 1 month ago

eval-exec commented 1 month ago

The code changes are copied from https://github.com/multiformats/rust-multiaddr/blob/master/src/onion_addr.rs

(No need to support Onion v2, it has been deprecated: https://support.torproject.org/onionservices/v2-deprecation/)

driftluo commented 20 hours ago

This is not enough at the moment, because in tentacle, when it dials out or receives a connection with any protocol, it will tag its multiaddr with the corresponding protocol. In the current implementation, this behavior cannot be seen, like this:

https://github.com/nervosnetwork/tentacle/blob/master/tentacle/src/transports/ws.rs#L183-L184