HTTP Client Library and CLI Tool with Tor Proxy Support
RustorHTTP is a powerful HTTP client library and command-line tool written in Rust that routes all requests through Tor, ensuring anonymity and privacy for web requests.
- π Features
- π Requirements
- π οΈ Installation
- π§ Usage
- π Command Reference
- π Advanced Examples
- π Security Features
- π Identity Rotation (v1.1.0)
- π Troubleshooting Common Issues
- π§ Future Features (Roadmap)
- β All HTTP Methods: GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS
- β Tor Integration: All requests routed through Tor SOCKS proxy
- β Authentication: Basic Auth and Bearer Token support
- β Multiple Body Types: JSON, Form Data, Plain Text, Raw Bytes
- β Header Management: Custom headers, User-Agent, Content-Type
- β Cookie Support: Automatic cookie handling
- β Query Parameters: URL query string parameters
- β Configurable Timeouts: Custom request timeouts
- β Verbose Output: Detailed response information
- β Custom Tor Proxy: Support for custom Tor proxy URLs
- β Identity Rotation: Fresh Tor identity on startup for enhanced anonymity
-
Tor: Must be running on your system
- Download from: https://www.torproject.org/download/
- Default port: 9050
- Alternative: Use Tor Browser (includes Tor daemon)
-
Rust: Latest stable version
- Install from: https://rustup.rs/
git clone <repository-url>
cd RustorHTTP
cargo build --release| Option | Description | Default |
|---|---|---|
--proxy <URL> |
Custom Tor proxy URL | socks5://127.0.0.1:9050 |
--verbose |
Enable verbose output | false |
--timeout <SECONDS> |
Request timeout | 30 |
--cookies |
Enable cookie handling | false |
--rotate-on-startup |
Fresh Tor identity on startup | false |
--control-port <ADDRESS:PORT> |
Tor control port | 127.0.0.1:9051 |
--control-password <PASSWORD> |
Tor control port password | None |
get- Send GET requestspost- Send POST requestsput- Send PUT requestsdelete- Send DELETE requestspatch- Send PATCH requestshead- Send HEAD requestsoptions- Send OPTIONS requests
Basic GET request:
cargo run get https://httpbin.org/ip
.\RustorHTTP-1.1.0-Windows-x64.exe get https://httpbin.org/ip
.\RustorHTTP-1.1.0-Linux-x64 get https://httpbin.org/ipGET with custom headers:
cargo run get https://httpbin.org/headers -H "X-Custom-Header:MyValue" -H "Accept:application/json"
.\RustorHTTP-1.1.0-Windows-x64.exe get https://httpbin.org/headers -H "X-Custom-Header:MyValue" -H "Accept:application/json"
.\RustorHTTP-1.1.0-Linux-x64 get https://httpbin.org/headers -H "X-Custom-Header:MyValue" -H "Accept:application/json"GET with User-Agent:
cargo run get https://httpbin.org/user-agent --user-agent "RustorHTTP/1.0"
.\RustorHTTP-1.1.0-Windows-x64.exe get https://httpbin.org/user-agent --user-agent "RustorHTTP/1.0"
.\RustorHTTP-1.1.0-Linux-x64 get https://httpbin.org/user-agent --user-agent "RustorHTTP/1.0"GET with query parameters:
cargo run get https://httpbin.org/get --query "param1=value1" --query "param2=value2"
.\RustorHTTP-1.1.0-Windows-x64.exe get https://httpbin.org/get --query "param1=value1" --query "param2=value2"
.\RustorHTTP-1.1.0-Linux-x64 get https://httpbin.org/get --query "param1=value1" --query "param2=value2"GET with Basic Authentication:
cargo run get https://httpbin.org/basic-auth/user/pass --auth "user:pass"
.\RustorHTTP-1.1.0-Windows-x64.exe get https://httpbin.org/basic-auth/user/pass --auth "user:pass"
.\RustorHTTP-1.1.0-Linux-x64 get https://httpbin.org/basic-auth/user/pass --auth "user:pass"GET with Bearer Token:
cargo run get https://httpbin.org/bearer --token "your-bearer-token-here"
.\RustorHTTP-1.1.0-Windows-x64.exe get https://httpbin.org/bearer --token "your-bearer-token-here"
.\RustorHTTP-1.1.0-Linux-x64 get https://httpbin.org/bearer --token "your-bearer-token-here"POST with JSON data:
cargo run post https://httpbin.org/post --json '{"name":"John","age":30,"city":"New York"}'
.\RustorHTTP-1.1.0-Windows-x64.exe post https://httpbin.org/post --json '{"name":"John","age":30,"city":"New York"}'
.\RustorHTTP-1.1.0-Linux-x64 post https://httpbin.org/post --json '{"name":"John","age":30,"city":"New York"}'POST with form data:
cargo run post https://httpbin.org/post --form "name=John" --form "[email protected]" --form "age=30"
.\RustorHTTP-1.1.0-Windows-x64.exe post https://httpbin.org/post --data "This is plain text data"
.\RustorHTTP-1.1.0-Linux-x64 post https://httpbin.org/post --data "This is plain text data"POST with plain text:
cargo run post https://httpbin.org/post --data "This is plain text data"
.\RustorHTTP-1.1.0-Windows-x64.exe post https://httpbin.org/post --data "This is plain text data"
.\RustorHTTP-1.1.0-Linux-x64 post https://httpbin.org/post --data "This is plain text data"POST with authentication:
cargo run post https://httpbin.org/post --json '{"message":"Hello"}' --token "your-api-token"
.\RustorHTTP-1.1.0-Windows-x64.exe post https://httpbin.org/post --json '{"message":"Hello"}' --token "your-api-token"
.\RustorHTTP-1.1.0-Linux-x64 post https://httpbin.org/post --json '{"message":"Hello"}' --token "your-api-token"PUT with JSON:
cargo run put https://httpbin.org/put --json '{"updated":"data","timestamp":"2024-01-01"}'
.\RustorHTTP-1.1.0-Windows-x64.exe put https://httpbin.org/put --json '{"updated":"data","timestamp":"2024-01-01"}'
.\RustorHTTP-1.1.0-Linux-x64 put https://httpbin.org/put --json '{"updated":"data","timestamp":"2024-01-01"}'PUT with custom headers:
cargo run put https://httpbin.org/put --data "Updated content" -H "Content-Type:text/plain" -H "X-Update-Source:RustorHTTP"
.\RustorHTTP-1.1.0-Windows-x64.exe put https://httpbin.org/put --data "Updated content" -H "Content-Type:text/plain" -H "X-Update-Source:RustorHTTP"
.\RustorHTTP-1.1.0-Linux-x64 put https://httpbin.org/put --data "Updated content" -H "Content-Type:text/plain" -H "X-Update-Source:RustorHTTP"Basic DELETE:
cargo run delete https://httpbin.org/delete
.\RustorHTTP-1.1.0-Windows-x64.exe delete https://httpbin.org/delete
.\RustorHTTP-1.1.0-Linux-x64 delete https://httpbin.org/deleteDELETE with authentication:
cargo run delete https://httpbin.org/delete --auth "admin:password"
.\RustorHTTP-1.1.0-Windows-x64.exe delete https://httpbin.org/delete --auth "admin:password"
.\RustorHTTP-1.1.0-Linux-x64 delete https://httpbin.org/delete --auth "admin:password"PATCH with JSON:
cargo run patch https://httpbin.org/patch --json '{"field":"new_value"}'
.\RustorHTTP-1.1.0-Windows-x64.exe patch https://httpbin.org/patch --json '{"field":"new_value"}'
.\RustorHTTP-1.1.0-Linux-x64 patch https://httpbin.org/patch --json '{"field":"new_value"}'HEAD request (headers only):
cargo run head https://httpbin.org/
.\RustorHTTP-1.1.0-Windows-x64.exe head https://httpbin.org/
.\RustorHTTP-1.1.0-Linux-x64 head https://httpbin.org/OPTIONS request:
cargo run options https://httpbin.org/
.\RustorHTTP-1.1.0-Windows-x64.exe options https://httpbin.org/
.\RustorHTTP-1.1.0-Linux-x64 options https://httpbin.org/Get detailed information about the request and response:
cargo run --verbose get https://httpbin.org/ip
.\RustorHTTP-1.1.0-Windows-x64.exe --verbose get https://httpbin.org/ip
.\RustorHTTP-1.1.0-Linux-x64 --verbose get https://httpbin.org/ipUse a different Tor proxy:
cargo run -- --proxy "socks5://127.0.0.1:9150" get https://httpbin.org/ip
.\RustorHTTP-1.1.0-Windows-x64.exe --proxy "socks5://127.0.0.1:9150" get https://httpbin.org/ip
.\RustorHTTP-1.1.0-Linux-x64 --proxy "socks5://127.0.0.1:9150" get https://httpbin.org/ipEnable automatic cookie management:
cargo run -- --cookies get https://httpbin.org/cookies/set/session/abc123
.\RustorHTTP-1.1.0-Windows-x64.exe --cookies get https://httpbin.org/cookies/set/session/abc123
.\RustorHTTP-1.1.0-Linux-x64 --cookies get https://httpbin.org/cookies/set/session/abc123
cargo run -- --cookies get https://httpbin.org/cookies
.\RustorHTTP-1.1.0-Windows-x64.exe --cookies get https://httpbin.org/cookies
.\RustorHTTP-1.1.0-Linux-x64 --cookies get https://httpbin.org/cookiesSet a custom timeout (10 seconds):
cargo run -- --timeout 10 get https://httpbin.org/delay/5
.\RustorHTTP-1.1.0-Windows-x64.exe --timeout 10 get https://httpbin.org/delay/5
.\RustorHTTP-1.1.0-Linux-x64 --timeout 10 get https://httpbin.org/delay/5cargo run --verbose -- --cookies post https://httpbin.org/post --json '{"user":"john","action":"login"}' -H "X-API-Version:v1" -H "X-Client:RustorHTTP" --user-agent "MyApp/1.0" --token "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
.\RustorHTTP-1.1.0-Windows-x64.exe --verbose --cookies post https://httpbin.org/post --json '{"user":"john","action":"login"}' -H "X-API-Version:v1" -H "X-Client:RustorHTTP" --user-agent "MyApp/1.0" --token "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
.\RustorHTTP-1.1.0-Linux-x64 --verbose --cookies post https://httpbin.org/post --json '{"user":"john","action":"login"}' -H "X-API-Version:v1" -H "X-Client:RustorHTTP" --user-agent "MyApp/1.0" --token "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."Test REST API:
# GET all users
cargo run get https://jsonplaceholder.typicode.com/users
.\RustorHTTP-1.1.0-Windows-x64.exe get https://jsonplaceholder.typicode.com/users
.\RustorHTTP-1.1.0-Linux-x64 get https://jsonplaceholder.typicode.com/users
# GET specific user
cargo run get https://jsonplaceholder.typicode.com/users/1
.\RustorHTTP-1.1.0-Windows-x64.exe get https://jsonplaceholder.typicode.com/users/1
.\RustorHTTP-1.1.0-Linux-x64 get https://jsonplaceholder.typicode.com/users/1
# CREATE new post
cargo run post https://jsonplaceholder.typicode.com/posts --json '{"title":"My Post","body":"This is the content","userId":1}'
.\RustorHTTP-1.1.0-Windows-x64.exe post https://jsonplaceholder.typicode.com/posts --json '{"title":"My Post","body":"This is the content","userId":1}'
.\RustorHTTP-1.1.0-Linux-x64 post https://jsonplaceholder.typicode.com/posts --json '{"title":"My Post","body":"This is the content","userId":1}'
# UPDATE post
cargo run put https://jsonplaceholder.typicode.com/posts/1 --json '{"id":1,"title":"Updated Title","body":"Updated content","userId":1}'
.\RustorHTTP-1.1.0-Windows-x64.exe put https://jsonplaceholder.typicode.com/posts/1 --json '{"id":1,"title":"Updated Title","body":"Updated content","userId":1}'
.\RustorHTTP-1.1.0-Linux-x64 put https://jsonplaceholder.typicode.com/posts/1 --json '{"id":1,"title":"Updated Title","body":"Updated content","userId":1}'
# PATCH post
cargo run patch https://jsonplaceholder.typicode.com/posts/1 --json '{"title":"Partially Updated Title"}'
.\RustorHTTP-1.1.0-Windows-x64.exe patch https://jsonplaceholder.typicode.com/posts/1 --json '{"title":"Partially Updated Title"}'
.\RustorHTTP-1.1.0-Linux-x64 patch https://jsonplaceholder.typicode.com/posts/1 --json '{"title":"Partially Updated Title"}'
# DELETE post
cargo run delete https://jsonplaceholder.typicode.com/posts/1
.\RustorHTTP-1.1.0-Windows-x64.exe delete https://jsonplaceholder.typicode.com/posts/1
.\RustorHTTP-1.1.0-Linux-x64 delete https://jsonplaceholder.typicode.com/posts/1All requests are automatically routed through Tor:
- Anonymity: Your real IP address is hidden
- Privacy: Traffic is encrypted through multiple relays
- Censorship Bypass: Access blocked websites
- Basic Auth: Username and password authentication
- Bearer Tokens: JWT and API token support
- Custom Headers: Full control over request headers
RustorHTTP can automatically change your Tor identity before each command execution, ensuring maximum anonymity by getting a new IP address and Tor circuit path.
torrc file because Tor Browser doesn't enable control port by default.
Location: C:\tor\torrc
# Required configuration
SocksPort 9050
ControlPort 9051
HashedControlPassword 16:4EC4431892AF1C6460463622FA381E9F6A679100029A59DAFB228E6A35
DataDirectory C:\tor\data
DisableNetwork 0# Generate hash for "MyPassword123"
tor --hash-password MyPassword123
# Output: 16:4EC4431892AF1C6460463622FA381E9F6A679100029A59DAFB228E6A35# Each command gets a new Tor identity and IP
cargo run -- --rotate-on-startup --control-password "MyPassword123" get https://httpbin.org/ip
.\RustorHTTP-1.1.0-Windows-x64.exe --rotate-on-startup --control-password "MyPassword123" get https://httpbin.org/ip
.\RustorHTTP-1.1.0-Linux-x64 --rotate-on-startup --control-password "MyPassword123" get https://httpbin.org/ipcargo run -- --control-port "127.0.0.1:9051" --rotate-on-startup --control-password "MyPassword123" get https://httpbin.org/ip
.\RustorHTTP-1.1.0-Windows-x64.exe --rotate-on-startup --control-password "MyPassword123" get https://httpbin.org/ip
.\RustorHTTP-1.1.0-Linux-x64 --rotate-on-startup --control-password "MyPassword123" get https://httpbin.org/ipflowchart TD
A["π Start"] --> B{"π --rotate-on-startup?"}
B -->|No| D["π‘ HTTP Request"]
B -->|Yes| C["π Connect Control Port"]
C --> E{"β
Connected?"}
E -->|No| F["β οΈ Continue without rotation"]
E -->|Yes| G["π SIGNAL NEWNYM"]
G --> H["β
New Identity"]
H --> I["β³ Wait 3s"]
I --> D
F --> D
D --> J["π¨ Response"]
J --> K["π End"]
Expected Output (-v is required for verbose output. Otherwise, the identity rotation output is not displayed.)
π Testing Tor control connection to 127.0.0.1:9051...
β
Tor control connection successful!
Identity rotation enabled:
- Control port: 127.0.0.1:9051
π Rotating identity on startup...
β
Identity rotation successful!
Sending GET request to: https://httpbin.org/ip
Status: 200 OK
Response Body:
{
"origin": "185.220.101.32"
}- Web Scraping: Fresh IP for each scraping session
- API Testing: Different identity per test
- Privacy Research: Guaranteed fresh circuits
- Automated Tasks: Simple, reliable anonymity
error: failed to run custom build command for `openssl-sys v0.9.109`
warning: [email protected]: Could not find directory of OpenSSL installation
- Problem: Missing OpenSSL development libraries when building for Linux targets
- Root Cause: The
openssl-syscrate requires OpenSSL headers and pkg-config to compile - Solution for Ubuntu (Same for Debian
dnf):# Update package list sudo apt update # Install required development packages sudo apt install pkg-config libssl-dev # Add Linux target (if cross-compiling) rustup target add x86_64-unknown-linux-gnu # Build for Linux cargo build --release --target x86_64-unknown-linux-gnu
- Problem:
β Warning: Could not connect to Tor control port at 127.0.0.1:9051 - Solution:
- Enable
ControlPort 9051in torrc - Restart Tor Browser
- Verify Tor is running: Windows:
netstat -an | findstr :9051Linux:netstat -an | grep :9051
- Enable
- Problem:
Authentication failed: 515 Bad authentication - Solution:
- Verify control password is correct
- Regenerate hash:
tor --hash-password YourPassword - Update
HashedControlPasswordin torrc
- Problem: IP doesn't change between
--rotate-on-startupcommands - Solution:
- Verify
--rotate-on-startupflag is used - Check
--control-passwordparameter - Ensure
DisableNetwork 0in torrc (notDisableNetwork 1)
- Verify
- Problem: Tor Browser resets
DisableNetwork 1on restart - Solution: Always set
DisableNetwork 0in custom torrc file
- Problem:
error: unexpected argument '--rotate-on-startup' found - Solution: Use
--to separate cargo flags from application flags:cargo run -- --rotate-on-startup --control-password "MyPassword123" get https://httpbin.org/ip
- Exit Node Selection: Choose specific exit nodes for requests
- Multi-threading Support: Concurrent HTTP requests with thread pool
- Async Request Batching: Send multiple requests simultaneously
- Connection Pooling: Reuse connections for better performance
- Request Queue Management: Priority-based request handling
- Bridge Support: Tor bridges for enhanced censorship resistance
- Proxy Chains: Multiple proxy layers (Tor + VPN)
- Traffic Obfuscation: Additional layers for traffic analysis resistance
- Tor Network Status: Monitor circuit health and performance
- Export Formats: JSON, CSV output for request logs
- Performance Metrics: Detailed timing and network statistics
- Certificate Pinning: Pin specific SSL certificates
- Request Fingerprinting Protection: Randomize headers and timing
- Anti-Detection Features: Mimic different browsers and clients
Note: These features are planned for future releases. Contributions and feature requests are welcome!