proxy-twister-1.0.1 is not a library.
Proxy Twister
A flexible HTTP proxy switcher that intelligently routes traffic through different proxies (SOCKS5 or HTTP) based on target host patterns.
Features
- Route traffic through different proxies based on domain/IP patterns
- Support for both SOCKS5 and HTTP proxies
- Direct connection option for local or trusted networks
- Pattern matching with wildcards for flexible routing rules
- Handles both HTTP and HTTPS (via CONNECT) connections
Installation
From Source
-
Ensure you have Rust and Cargo installed (https://rustup.rs/)
-
Clone this repository:
git clone https://github.com/mlesin/proxy-twister.git cd proxy-twister -
Build the project:
cargo build --release -
The binary will be available at
target/release/proxy-twister
Configuration
Create a configuration file in JSON format. Here's an example:
Configuration Explanation
-
switch: Contains the routing rules
- default: The default profile to use when no pattern matches
- rules: List of pattern-matching rules to determine which proxy to use
- pattern: A domain/IP pattern (supports wildcards)
- profile: The profile to use when the pattern matches
-
profiles: Defines the available proxy configurations
- Each profile has a unique name and configuration:
- direct: No proxy, direct connection
- http: HTTP proxy with host and port
- socks5: SOCKS5 proxy with host and port
- Each profile has a unique name and configuration:
Usage
Run the program with:
proxy-twister --config config.json [--address 127.0.0.1] [--port 1080]
Options:
--config: Path to the configuration file (required)--address: Address to listen on (default: 127.0.0.1)--port: Port to listen on (default: 1080)
Then configure your applications to use the proxy at the address and port you specified.
Pattern Matching
The pattern matching supports:
- Exact matches:
example.com - Wildcard at beginning:
*.example.com(matchessub.example.com,example.com) - IP prefix matching:
192.168.*(matches any IP starting with 192.168)
Examples
Route specific sites through Tor
Use direct connection for local networks