https://github.com/KaranGauswami/socks-to-http-proxy
An executable to convert SOCKS5 proxy into HTTP proxy
https://github.com/KaranGauswami/socks-to-http-proxy
http-proxy proxy rust socks5
Last synced: about 1 year ago
JSON representation
An executable to convert SOCKS5 proxy into HTTP proxy
- Host: GitHub
- URL: https://github.com/KaranGauswami/socks-to-http-proxy
- Owner: KaranGauswami
- License: mit
- Created: 2020-10-23T16:31:35.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-07-27T12:52:28.000Z (almost 2 years ago)
- Last Synced: 2024-07-27T13:59:30.363Z (almost 2 years ago)
- Topics: http-proxy, proxy, rust, socks5
- Language: Rust
- Homepage:
- Size: 123 KB
- Stars: 219
- Watchers: 5
- Forks: 32
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# socks-to-http-proxy  
An executable to convert SOCKS5 proxy into HTTP proxy
## About
`sthp` purpose is to create HTTP proxy on top of the Socks 5 Proxy
## How it works
It uses hyper library HTTP proxy [example](https://github.com/hyperium/hyper/blob/master/examples/http_proxy.rs) and adds functionality to connect via Socks5
## Compiling
Follow these instructions to compile
1. Ensure you have current version of `cargo` and [Rust](https://www.rust-lang.org) installed
2. Clone the project `$ git clone https://github.com/KaranGauswami/socks-to-http-proxy.git && cd socks-to-http-proxy`
3. Build the project `$ cargo build --release`
4. Once complete, the binary will be located at `target/release/sthp`
## Usage
```bash
sthp -p 8080 -s 127.0.0.1:1080
```
This will create proxy server on 8080 and use localhost:1080 as a Socks5 Proxy
```bash
sthp -p 8080 -s example.com:8080
```
This will create proxy server on 8080 and use example:1080 as a Socks5 Proxy
> [!NOTE]
> The --socks-address (-s) flag does not support adding a schema at the start (e.g., socks:// or socks5h://). Currently, it only supports socks5h, which means DNS resolution will be done on the SOCKS server.
> [!WARNING]
> After v5, Changed default listening IP from `0.0.0.0` to `127.0.0.1`. This change restricts the application access to the local machine only.
### Options
There are a few options for using `sthp`.
```text
Usage: sthp [OPTIONS]
Options:
-p, --port port where Http proxy should listen [default: 8080]
--listen-ip [default: 127.0.0.1]
-u, --username Socks5 username
-P, --password Socks5 password
-s, --socks-address Socks5 proxy address [default: 127.0.0.1:1080]
--allowed-domains Comma-separated list of allowed domains
--http-basic HTTP Basic Auth credentials in the format "user:passwd"
-d, --detached Run process in background ( Only for Unix based systems)
-h, --help Print help
-V, --version Print version
```