| Crates.io | libtor |
| lib.rs | libtor |
| version | 47.13.0+0.4.7.x |
| created_at | 2020-03-12 21:30:34.778839+00 |
| updated_at | 2023-02-10 21:28:00.791266+00 |
| description | Bundle and run Tor inside your own project |
| homepage | https://github.com/MagicalBitcoin/libtor |
| repository | https://github.com/MagicalBitcoin/libtor |
| max_upload_size | |
| id | 217941 |
| size | 24,015 |
libtor is a Rust crate for bundling inside your project a fully-running Tor daemon.
It exposes a nicer interface to operate it compared to the bare-bones version, libtor-sys.
If you need further instructions on how to build or cross-compile the project, you should refer to the libtor-sys README.md.
libtor makes it easier for projects on multiple platforms to use Tor without depending on the user to configure complex proxy settings from other external software.
use libtor::{Tor, TorFlag, TorAddress, HiddenServiceVersion};
Tor::new()
.flag(TorFlag::DataDirectory("/tmp/tor-rust".into()))
.flag(TorFlag::SocksPort(19050))
.flag(TorFlag::HiddenServiceDir("/tmp/tor-rust/hs-dir".into()))
.flag(TorFlag::HiddenServiceVersion(HiddenServiceVersion::V3))
.flag(TorFlag::HiddenServicePort(TorAddress::Port(8000), None.into()))
.start()?;
Since Tor uses internally some static variables to keep its state, keep in mind that you can't start more than one Tor instance per process.
The currently supported platforms are:
mingwComing Soon :tm::
The following dependencies are needed:
opensslpkg-configfileautomake, autoconf