You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current Version: v0.5.7 | Arti: 1.8.0 (tor-proto 0.37.0)
A browser-focused Tor client written in Rust and compiled to WebAssembly (WASM), with optional native support. It enables anonymous HTTP/HTTPS connections through the Tor network directly from web browsers, without requiring plugins, extensions, or native applications.
Key Capabilities
Capability
Implementation
Status
Tor Protocol
tor-proto crate (official Arti)
Full support for v3-v5
Circuit Creation
CREATE2 with ntor-v3 handshake
Modern, secure
TLS Security
TLS 1.3 (preferred) with TLS 1.2 fallback and certificate validation
Hardened, actively tested
Snowflake Bridge
WebSocket + WebRTC transports
WASM-compatible
WebTunnel Bridge
HTTPS with RFC 9298 upgrade
Native + WASM
Consensus
Embedded snapshot + online fetch
Daily auto-updates, 1h cache
Cryptography
SubtleCrypto (browser) + Dalek crates
Audited libraries
Features
Arti-based - Uses official Tor Project crates with full TLS validation
Two Transports - Snowflake (WebRTC) and WebTunnel (HTTPS)
Full Tor Protocol - 3-hop circuits with ntor-v3 handshakes
TLS 1.3 + 1.2 Support - Pure-Rust TLS via SubtleCrypto (WASM) with automatic TLS 1.2 fallback
Stream Isolation - Separate circuits per domain using Mozilla's Public Suffix List (Tor Browser-style)
Circuit Reuse - Persistent circuits for performance
Consensus Handling - Embedded snapshot + online fetching with 1-hour caching (no CORS issues)
Quick Start
./build.sh
cd webtor-demo/static && python3 -m http.server 8000
# Open http://localhost:8000
Usage
use webtor::{TorClient,TorClientOptions};// Snowflake (WASM only - uses WebRTC)let client = TorClient::new(TorClientOptions::snowflake()).await?;// WebTunnel (WASM + Native) let client = TorClient::new(TorClientOptions::webtunnel(url, fingerprint)).await?;// Configure stream isolation (default: PerDomain)let client = TorClient::new(TorClientOptions::snowflake().with_stream_isolation(StreamIsolationPolicy::PerDomain)).await?;// Bootstrap and make requests
client.bootstrap().await?;let response = client.get("https://example.com/").await?;println!("{}", response.text()?);// POST requestlet body = b"key=value".to_vec();let response = client.post("https://httpbin.org/post", body).await?;
client.close().await;
WASM / JavaScript API
importinit,{TorClient,TorClientOptions}from'webtor-wasm';awaitinit();constoptions=TorClientOptions.snowflakeWebRtc();constclient=awaitnewTorClient(options);// GET requestconstresponse=awaitclient.fetch('https://example.com/');console.log(awaitresponse.text());// POST request (raw body)constbody=newTextEncoder().encode('key=value');constresponse=awaitclient.post('https://httpbin.org/post',body);// POST JSON (convenience for JSON-RPC, auto-sets Content-Type)constresponse=awaitclient.postJson('https://rpc.example.com',JSON.stringify({jsonrpc: '2.0',method: 'eth_blockNumber',params: [],id: 1}));constdata=awaitresponse.json();// Full control: custom method, headers, body, timeoutconstresponse=awaitclient.request('POST','https://api.example.com',{'Content-Type': 'application/json','Authorization': 'Bearer token'},body,30000// timeout in ms);awaitclient.close();
# Unit tests
cargo test -p webtor
# Property-based tests (proptest)
cargo test -p webtor proptest
# E2E tests (requires network)
npm run test:tls
# Benchmarks (requires network)
cargo bench -p webtor --bench tor_benchmark
# Criterion microbenchmarks (deterministic)
cargo bench -p webtor --bench circuit_params
# Fuzz tests (manual trigger via GitHub Actions)cd subtle-tls/fuzz && cargo +nightly fuzz run fuzz_server_hello
CI/CD
Workflow
Trigger
Purpose
Tests
Push/PR
Unit tests, E2E, WASM build, Clippy, Rustfmt
Property Tests
Push/PR
Proptest for turbo, smux, relay modules
Fuzz Testing
Manual
Fuzz testing for TLS parsing
WASM Build
Push/PR
Build and size check
Release WASM
Tags
Build, optimize, publish to GitHub + R2 CDN
Daily Consensus
Scheduled
Update cached consensus data
Deploy Example
Push to main
Deploy demo to GitHub Pages
CDN
Pre-built webtor-wasm bindings are published to Cloudflare R2 on each release for use in your own projects:
<!-- Use latest version --><scripttype="module">importinit,{TorClient,TorClientOptions}from'https://webtor-wasm.53627.org/webtor-wasm/latest/webtor_wasm.js';awaitinit();constclient=awaitnewTorClient(TorClientOptions.snowflakeWebRtc());awaitclient.waitForCircuit();constresponse=awaitclient.fetch('https://example.com');</script><!-- Or pin to specific version --><scripttype="module">importinitfrom'https://webtor-wasm.53627.org/webtor-wasm/v0.5.6/webtor_wasm.js';</script>