Socks to HTTP Proxy (sthp)

Convert a SOCKS5 proxy into an HTTP proxy.

Why use sthp?

One binary

Turn any SOCKS5 proxy into an HTTP proxy in seconds.

Authentication

SOCKS5 username/password; optional HTTP Basic on the HTTP proxy.

Access control

Allowlist outbound domains with --allowed-domains.

Fast & portable

Native Rust binary for macOS, Linux, and Windows.

Install

Prerequisite: Ensure cargo is installed. Install Rust & Cargo from the official guide.

cargo install sthp

Or download prebuilt binaries from GitHub Releases.

Verify your toolchain:

cargo --version 

Build from source

git clone https://github.com/KaranGauswami/socks-to-http-proxy.git
cd socks-to-http-proxy
cargo build --release
# binary at target/release/sthp

Quick start

sthp -p 8080 -s 127.0.0.1:1080

This starts an HTTP proxy on 127.0.0.1:8080 that forwards via the SOCKS5 proxy at 127.0.0.1:1080.

sthp -p 8080 -s example.com:1080

The -s flag currently supports socks5h semantics (DNS resolves on the SOCKS server); omit any schema like socks://.

Options

Usage: sthp [OPTIONS]

Options:
  -p, --port <PORT>                        port where Http proxy should listen [default: 8080]
      --listen-ip <LISTEN_IP>              [default: 127.0.0.1]
  -u, --username <USERNAME>                Socks5 username
  -P, --password <PASSWORD>                Socks5 password
  -s, --socks-address <SOCKS_ADDRESS>      Socks5 proxy address [default: 127.0.0.1:1080]
      --allowed-domains <ALLOWED_DOMAINS>  Comma-separated list of allowed domains
      --http-basic <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