Crate libp2p_community_tor
source ·Expand description
Tor based transport for libp2p. Connect through the Tor network to TCP listeners.
⚠️ Misuse warning ⚠️ - read carefully before using
Although the sound of “Tor” might convey a sense of security it is very easy to misuse this crate and leaking private information while using. Study libp2p carefully and try to make sure you fully understand it’s current limits regarding privacy. I.e. using identify might already render this transport obsolete.
This transport explicitly doesn’t provide any enhanced privacy if it’s just used like a regular transport. Use with caution and at your own risk. Don’t just blindly advertise Tor without fully understanding what you are dealing with.
Main entrypoint of the crate: TorTransport
Features
You have to enable a TLS provider and a runtime. The TLS providers are:
The runtimes are:
With that the transports you have to use are:
rustls | native-tls | |
---|---|---|
tokio | TokioRustlsTorTransport | TokioNativeTlsTorTransport |
async-std | AsyncStdRustlsTorTransport | AsyncStdNativeTlsTorTransport |
Example (async-std + native-tls)
let address = "/dns/www.torproject.org/tcp/1000".parse()?;
let mut transport = libp2p_community_tor::AsyncStdNativeTlsTorTransport::bootstrapped().await?;
// we have achieved tor connection
let _conn = transport.dial(address)?.await?;
Structs
Enums
Type Definitions
native-tls
and async-std
rustls
and async-std
async-std
native-tls
and tokio
rustls
and tokio