| Crates.io | proxy-twister |
| lib.rs | proxy-twister |
| version | 1.1.7 |
| created_at | 2025-04-15 06:51:59.271356+00 |
| updated_at | 2025-07-03 15:20:41.678957+00 |
| description | A flexible HTTP proxy switcher that routes traffic through different proxies (SOCKS5 or HTTP) based on target host patterns. |
| homepage | https://github.com/mlesin/proxy-twister |
| repository | https://github.com/mlesin/proxy-twister |
| max_upload_size | |
| id | 1634030 |
| size | 116,905 |
A flexible HTTP proxy switcher that intelligently routes traffic through different proxies (SOCKS5 or HTTP) based on target host patterns.
Install the latest release directly from crates.io:
cargo install proxy-twister
This will install the proxy-twister binary into your Cargo bin directory (usually ~/.cargo/bin).
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
Create a configuration file in JSON format. Here's an example:
{
"switch": {
"default": "regular",
"rules": [
{
"pattern": "10.*",
"profile": "direct"
},
{
"pattern": "127.0.0.1",
"profile": "direct"
},
{
"pattern": "*.discord.gg",
"profile": "tor"
},
{
"pattern": "*.discord.com",
"profile": "tor"
},
{
"pattern": "*.medium.com",
"profile": "monkey"
}
]
},
"profiles": {
"direct": {
"scheme": "direct"
},
"regular": {
"scheme": "http",
"port": 1080,
"host": "localhost"
},
"tor": {
"scheme": "socks5",
"host": "localhost",
"port": 9150
},
"monkey": {
"scheme": "socks5",
"host": "localhost",
"port": 8884
}
}
}
switch: Contains the routing rules
profiles: Defines the available proxy configurations
Run the program with:
proxy-twister --config config.json --listen 127.0.0.1:1080 --listen 127.0.0.1:8080
Options:
--config: Path to the configuration file (required)--listen/-l: Address to listen on (can be specified multiple times; default: 127.0.0.1:1080)You can specify multiple --listen/-l options to listen on several addresses/ports at once. Example:
proxy-twister --config config.json -l 127.0.0.1:1080 -l 127.0.0.1:8080
Then configure your applications to use the proxy at any of the addresses and ports you specified.
The pattern matching supports:
example.com*.example.com (matches sub.example.com, example.com)192.168.* (matches any IP starting with 192.168){
"pattern": "*.onion",
"profile": "tor"
}
{
"pattern": "192.168.*",
"profile": "direct"
}