Expand description
Tor Integration for Privacy-Preserving Networking
This module provides integration with the Tor network for anonymous and privacy-preserving peer-to-peer communication. It supports both client connections through Tor and hosting hidden services for anonymous server endpoints.
§Features
- SOCKS5 Proxy: Connect to peers through Tor’s SOCKS5 proxy
- Onion Routing: Multi-hop encrypted routing for anonymity
- Hidden Services: Host anonymous .onion endpoints
- Circuit Management: Control Tor circuits for optimal performance
- Stream Isolation: Separate streams for different applications
- Bandwidth Management: Throttle Tor traffic to avoid network congestion
§Use Cases
- Privacy: Hide IP addresses from peers and network observers
- Censorship Resistance: Access content in restrictive networks
- Anonymous Publishing: Host content without revealing location
- Surveillance Protection: Protect against traffic analysis
§Example
use ipfrs_network::tor::{TorManager, TorConfig, HiddenServiceConfig};
// Create Tor manager
let config = TorConfig::default();
let mut manager = TorManager::new(config).await?;
// Start Tor
manager.start().await?;
// Connect through Tor
let peer_addr = "example.onion:8080";
let stream = manager.connect(peer_addr).await?;
// Create hidden service
let hs_config = HiddenServiceConfig::default();
let onion_addr = manager.create_hidden_service(hs_config).await?;
println!("Hidden service available at: {}", onion_addr);Structs§
- Circuit
Info - Information about a Tor circuit
- Hidden
Service Config - Hidden service configuration
- TorConfig
- Configuration for Tor manager
- TorManager
- Tor network manager
- TorStats
- Statistics for Tor operations
Enums§
- Circuit
State - Tor circuit state
- TorError
- Errors that can occur in Tor operations
Type Aliases§
- Circuit
Id - Tor circuit identifier
- Onion
Address - Onion address (e.g., “example.onion”)
- Result
- Result type for Tor operations
- Stream
Id - Stream identifier