| Crates.io | tor-tunnels |
| lib.rs | tor-tunnels |
| version | 1.2.0 |
| created_at | 2024-12-01 20:52:00.969586+00 |
| updated_at | 2025-06-29 15:31:48.367755+00 |
| description | Create bindadle TCP tunnels to hidden services (.onion) over Tor |
| homepage | |
| repository | https://git.haveno.com/haveno/packages/tor-tunnels |
| max_upload_size | |
| id | 1467829 |
| size | 56,810 |
This application creates a TCP tunnel that allows clients to connect to a Tor hidden service through a SOCKS5 proxy. It listens for incoming TCP connections, connects to the hidden service using the provided SOCKS5 proxy, and then forwards data between the client and the hidden service.
tokio: For asynchronous runtime.tokio-socks: A library to work with SOCKS5 proxies in Tokio.tokio-io: For handling bidirectional I/O between the client and hidden service.Clone the repository:
git clone https://github.com/KewbitXMR/tor-tunnels.git
cd tor-tunnels
Build the project:
cargo build --release
Before running the application, you need to configure the following parameters:
listen_addr: The local address and port the tunnel will listen on for incoming connections (e.g., 127.0.0.1:5656).socks5_proxy: The SOCKS5 proxy address to use for connecting to the Tor network (e.g., 127.0.0.1:9050 for a local Tor proxy).hidden_service_addr: The address and port of the hidden service you want to tunnel to (e.g., anyonionaddresswillworkhere.onion:2001).You can adjust these values in the main function of src/main.rs as needed.
Run the application:
cargo run --release
The server will start listening on the listen_addr (e.g., 127.0.0.1:5656) for incoming connections.
Clients can connect to the specified address and port. The server will then establish a connection to the hidden service through the SOCKS5 proxy and forward the data between the client and the hidden service.
main function binds a TCP listener to listen_addr and waits for incoming connections.tokio::spawn.handle_client function:
Socks5Stream::connect.tokio::io::copy_bidirectional.You can use the endpoints spawn, list and destroy to manage tunnels through the listening address specified in a RESTful design.
Developed and maintainted by Kewbit originally for use in the haveno desktop client.