Crate revery_onion

Crate revery_onion 

Source
Expand description

Tor onion service integration for Revery messaging

This crate provides high-level interfaces for creating Tor onion services and connecting to them as clients. It abstracts the complexity of Tor integration while providing the anonymity and NAT traversal capabilities needed for secure messaging.

§Examples

Creating an onion service:

use revery_onion::OnionService;

async fn host_example() -> Result<(), Box<dyn std::error::Error>> {
    let mut service = OnionService::new().await?;
    let address = service.onion_address().unwrap();
    println!("Service available at: {}", address);

    let stream = service.accept_connection().await?;
    // Use stream for Revery messaging...
    Ok(())
}

Connecting to an onion service:

use revery_onion::OnionClient;

async fn client_example() -> Result<(), Box<dyn std::error::Error>> {
    let client = OnionClient::new().await?;
    let stream = client.connect("example.onion", 80).await?;
    // Use stream for Revery messaging...
    Ok(())
}

Structs§

DataStream
An anonymized stream over the Tor network.
OnionClient
Tor onion service client for connecting to hidden services
OnionService
Tor onion service host for accepting incoming connections

Enums§

OnionError