MCPcopy Index your code
hub / github.com/0x676e67/vproxy

github.com/0x676e67/vproxy @v2.5.5

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.5.5 ↗ · + Follow
309 symbols 498 edges 40 files 75 documented · 24%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

vproxy

CI Crates.io License Crates.io MSRV crates.io Crates.io Total Downloads

🚀 Help me work seamlessly with open source sharing by sponsoring me on GitHub

A high-performance HTTP/HTTPS/SOCKS5 proxy server

Features

  • Proxy extensions
  • Concurrency limits
  • Basic authentication
  • Auto protocol detection
  • Kernel-space zero-copy
  • IPv4/IPv6 dual-stack
  • Service binding to specific CIDR addresses
  • SOCKS5: CONNECT/BIND/ASSOCIATE

Manual

$ vproxy -h
A high-performance HTTP/HTTPS/SOCKS5 proxy server

Usage: vproxy
       vproxy <COMMAND>

Commands:
  run      Run server
  start    Start server daemon
  restart  Restart server daemon
  stop     Stop server daemon
  ps       Show server daemon process
  log      Show server daemon log
  self     Modify server installation
  help     Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

Installation

If you need more detailed installation and usage information, please check here

Install

  • curl
curl -sSL https://raw.githubusercontent.com/0x676e67/vproxy/main/.github/install.sh | bash
  • wget
wget -qO- https://raw.githubusercontent.com/0x676e67/vproxy/main/.github/install.sh | bash
  • cargo
cargo install vproxy
  • Dokcer
docker run --rm -it ghcr.io/0x676e67/vproxy:latest run http

Note

If you run the program as root, it will automatically configure the sysctl net.ipv6.ip_nonlocal_bind=1, net.ipv6.conf.all.disable_ipv6, and ip route add local 2001:470:e953::/48 dev lo for you. Otherwise you will need to configure these settings manually.

If no subnet is configured, the local default network proxy request will be used. When the local machine sets the priority Ipv4/Ipv6 and the priority is Ipv4, it will always use Ipv4 to make requests (if any).

# Enable binding to non-local IPv6 addresses
sudo sysctl net.ipv6.ip_nonlocal_bind=1

# Enable IPv6
sudo sysctl net.ipv6.conf.all.disable_ipv6=0

# Replace with your IPv6 subnet
sudo ip route add local 2001:470:e953::/48 dev lo

# Run the server http/socks5
vproxy run -i 2001:470:e953::/48 http

# Start the daemon (runs in the background), requires sudo
sudo vproxy start -i 2001:470:e953::/48 http

# Restart the daemon, requires sudo
sudo vproxy restart

# Stop the daemon, requires sudo
sudo vproxy stop

# Show daemon log
vproxy log

# Show daemon status
vproxy status

# Download and install updates to vproxy
vproxy self update

# Uninstall vproxy
vproxy self uninstall

# Test loop request
while true; do curl -x http://127.0.0.1:8100 -s https://api.ip.sb/ip -A Mozilla; done
...
2001:470:e953:5b75:c862:3328:3e8f:f4d1
2001:470:e953:b84d:ad7d:7399:ade5:4c1c
2001:470:e953:4f88:d5ca:84:83fd:6faa
2001:470:e953:29f3:41e2:d3f2:4a49:1f22
2001:470:e953:98f6:cb40:9dfd:c7ab:18c4
2001:470:e953:f1d7:eb68:cc59:b2d0:2c6f

Multi-Protocol Support

vproxy supports multiple types of proxy servers with flexible configuration options. HTTP, HTTPS, and SOCKS5 proxies can run independently, or use the auto-detection mode to handle all protocols on a single port. Each server type supports authentication, custom binding addresses, and advanced socket configurations.

  1. HTTP Proxy
# Basic HTTP proxy
vproxy run http

# HTTP proxy with authentication
vproxy run http -u username -p password

# HTTP proxy on custom port
vproxy run --bind 0.0.0.0:8080 http
  1. HTTPS Proxy
# HTTPS proxy with TLS certificates
vproxy run https --tls-cert cert.pem --tls-key key.pem

# HTTPS proxy with authentication
vproxy run https --tls-cert cert.pem --tls-key key.pem -u username -p password

If no TLS certificate is provided, vproxy will automatically generate a self-signed certificate for HTTPS connections.

  1. SOCKS5 Proxy
# Basic SOCKS5 proxy
vproxy run socks5

# SOCKS5 proxy with authentication
vproxy run socks5 -u username -p password

# SOCKS5 proxy on custom port
vproxy run --bind 0.0.0.0:1080 socks5
  1. Auto Protocol Detection
# Auto-detect HTTP/HTTPS/SOCKS5 protocols on single port
vproxy run auto

# Auto-detect with HTTPS support
vproxy run auto --tls-cert cert.pem --tls-key key.pem

# Auto-detect with authentication
vproxy run auto -u username -p password --tls-cert cert.pem --tls-key key.pem

The auto-detection server automatically identifies the protocol type and routes connections to the appropriate handler.

  • TTL Extension

Append -ttl- to the username, where TTL is a fixed value (e.g., username-ttl-2). The TTL value is the number of requests that can be made with the same IP. When the TTL value is reached, the IP will be changed.

  • Session Extension

Append -session-id to the username, where session is a fixed value and ID is an arbitrary random value (e.g., username-session-123456). Keep the Session ID unchanged to use a fixed IP.

  • Range Extension

Append -range-id to the username, where range is a fixed value and ID is any random value (e.g. username-range-123456). By keeping the Range ID unchanged, you can use a fixed CIDR range in a fixed range. in addition, you must set the startup parameter --cidr-range, and the length is within a valid range.

Examples

  • Http proxy session with username and password:
vproxy run --bind 127.0.0.1:1080 -i 2001:470:70c6::/48 http -u test -p test

$ for i in `seq 1 10`; do curl -x "http://test-session-123456789:test@127.0.0.1:1080" https://api6.ipify.org; done
2001:470:70c6:93ee:9b7c:b4f9:4913:22f5
2001:470:70c6:93ee:9b7c:b4f9:4913:22f5
2001:470:70c6:93ee:9b7c:b4f9:4913:22f5

$ for i in `seq 1 10`; do curl -x "http://test-session-987654321:test@127.0.0.1:1080" https://api6.ipify.org; done
2001:470:70c6:41d0:14fd:d025:835a:d102
2001:470:70c6:41d0:14fd:d025:835a:d102
2001:470:70c6:41d0:14fd:d025:835a:d102
  • Socks5 proxy session with username and password
vproxy run --bind 127.0.0.1:1080 -i 2001:470:70c6::/48 socks5 -u test -p test

$ for i in `seq 1 3`; do curl -x "socks5h://test-session-123456789:test@127.0.0.1:1080" https://api6.ipify.org; done
2001:470:70c6:93ee:9b7c:b4f9:4913:22f5
2001:470:70c6:93ee:9b7c:b4f9:4913:22f5
2001:470:70c6:93ee:9b7c:b4f9:4913:22f5

$ for i in `seq 1 3`; do curl -x "socks5h://test-session-987654321:test@127.0.0.1:1080" https://api6.ipify.org; done
2001:470:70c6:41d0:14fd:d025:835a:d102
2001:470:70c6:41d0:14fd:d025:835a:d102
2001:470:70c6:41d0:14fd:d025:835a:d102

  • TTL proxy session with username and password
vproxy run --bind 127.0.0.1:1080 -i 2001:470:70c6::/48 socks5 -u test -p test

$ for i in `seq 1 3`; do curl -x "socks5h://test-ttl-2:test@127.0.0.1:1080" https://api6.ipify.org; done
2001:470:70c6:93ee:9b7c:b4f9:4913:22f5
2001:470:70c6:93ee:9b7c:b4f9:4913:22f5
2001:470:70c6:93ee:9b7c:b4f9:4913:22f6

$ for i in `seq 1 3`; do curl -x "socks5h://test-ttl-2:test@127.0.0.1:1080" https://api6.ipify.org; done
2001:470:70c6:41d0:14fd:d025:835a:d102
2001:470:70c6:41d0:14fd:d025:835a:d102
2001:470:70c6:41d0:14fd:d025:835a:d105

Benchmark

If you need more detailed benchmark information, please check here

Hardware/Software

  • CPU: Apple M3 Max (16) @ 4.06 GHz
  • OS: Ubuntu 25.04 aarch64 (6.15.11-orbstack-00542-g4f455d264886)
  • Iperf3: 3.18
  • Proxychains-ng: 4.17

Tests performed in virtualized environment (OrbStack). Performance may vary due to VM overhead and resource sharing.

Topology

iperf3 server <---> socks5 server <---> iperf3 client

vproxy

  1. version vproxy 2.5.1
  2. repository: https://github.com/0x676e67/vproxy
  3. command
vproxy run socks5
  • Upload
$ proxychains iperf3 -c 127.0.0.1
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.01  sec   167 GBytes   143 Gbits/sec    1            sender
[  5]   0.00-10.01  sec   167 GBytes   143 Gbits/sec                  receiver
$ proxychains iperf3 -c 127.0.0.1 -P 10
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  9]   0.00-10.00  sec  40.8 GBytes  35.1 Gbits/sec    9            sender
[  9]   0.00-10.00  sec  40.8 GBytes  35.1 Gbits/sec                  receiver
[ 11]   0.00-10.00  sec  43.6 GBytes  37.4 Gbits/sec   10            sender
[ 11]   0.00-10.00  sec  43.6 GBytes  37.4 Gbits/sec                  receiver
[ 13]   0.00-10.00  sec  41.9 GBytes  36.0 Gbits/sec   11            sender
[ 13]   0.00-10.00  sec  41.9 GBytes  36.0 Gbits/sec                  receiver
[ 15]   0.00-10.00  sec  42.2 GBytes  36.2 Gbits/sec   10            sender
[ 15]   0.00-10.00  sec  42.2 GBytes  36.2 Gbits/sec                  receiver
[ 17]   0.00-10.00  sec  41.2 GBytes  35.4 Gbits/sec   11            sender
[ 17]   0.00-10.00  sec  41.2 GBytes  35.4 Gbits/sec                  receiver
[ 19]   0.00-10.00  sec  41.2 GBytes  35.4 Gbits/sec   10            sender
[ 19]   0.00-10.00  sec  41.2 GBytes  35.4 Gbits/sec                  receiver
[ 21]   0.00-10.00  sec  43.3 GBytes  37.2 Gbits/sec   15            sender
[ 21]   0.00-10.00  sec  43.3 GBytes  37.2 Gbits/sec                  receiver
[ 23]   0.00-10.00  sec  40.6 GBytes  34.8 Gbits/sec    8            sender
[ 23]   0.00-10.00  sec  40.6 GBytes  34.8 Gbits/sec                  receiver
[ 25]   0.00-10.00  sec  40.2 GBytes  34.5 Gbits/sec   12            sender
[ 25]   0.00-10.00  sec  40.2 GBytes  34.5 Gbits/sec                  receiver
[ 27]   0.00-10.00  sec  42.6 GBytes  36.6 Gbits/sec   10            sender
[ 27]   0.00-10.00  sec  42.6 GBytes  36.6 Gbits/sec                  receiver
[SUM]   0.00-10.00  sec   418 GBytes   359 Gbits/sec  106             sender
[SUM]   0.00-10.00  sec   417 GBytes   359 Gbits/sec                  receiver
  • Download
$ proxychains iperf3 -c 127.0.0.1 -R
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  9]   0.00-10.01  sec   116 GBytes  99.5 Gbits/sec    0            sender
[  9]   0.00-10.01  sec   116 GBytes  99.5 Gbits/sec                  receiver
$ proxychains iperf3 -c 127.0.0.1 -R -P 10
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  9]   0.00-10.00  sec  42.7 GBytes  36.7 Gbits/sec   10            sender
[  9]   0.00-10.00  sec  42.7 GBytes  36.7 Gbits/sec                  receiver
[ 11]   0.00-10.00  sec  45.8 GBytes  39.4 Gbits/sec   12            sender
[ 11]   0.00-10.00  sec  45.8 GBytes  39.4 Gbits/sec                  receiver
[ 13]   0.00-10.00  sec  43.5 GBytes  37.3 Gbits/sec    9            sender
[ 13]   0.00-10.00  sec  43.5 GBytes  37.3 Gbits/sec                  receiver
[ 15]   0.00-10.00  sec  42.4 GBytes  36.4 Gbits/sec    7            sender
[ 15]   0.00-10.00  sec  42.4 GBytes  36.4 Gbits/sec                  receiver
[ 17]   0.00-10.00  sec  42.1 GBytes  36.1 Gbits/sec   13            sender
[ 17]   0.00-10.00  sec  42.1 GBytes  36.1 Gbits/sec                  receiver
[ 19]   0.00-10.00  sec  40.1 GBytes  34.4 Gbits/sec    6            sender
[ 19]   0.00-10.00  sec  40.1 GBytes  34.4 Gbits/sec                  receiver
[ 21]   0.00-10.00  sec  42.3 GBytes  36.3 Gbits/sec    8            sender
[ 21]   0.00-10.00  sec  42.3 GBytes  36.3 Gbits/sec                  receiver
[ 23]   0.00-10.00  sec  43.1 GBytes  37.0 Gbits/sec    9            sender
[ 23]   0.00-10.00  sec  43.1 GBytes  37.0 Gbits/sec                  receiver
[ 25]   0.00-10.00  sec  42.8 GBytes  36.8 Gbits/sec    8            sender
[ 25]   0.00-10.00  sec  42.8 GBytes  36.7 Gbits/sec                  receiver
[ 27]   0.00-10.00  sec  42.4 GBytes  36.4 Gbits/sec    8            sender
[ 27]   0.00-10.00  sec  42.4 GBytes  36.4 Gbits/sec                  receiver
[SUM]   0.00-10.00  sec   427 GBytes   367 Gbits/sec   90             sender
[SUM]   0.00-10.00  sec   427 GBytes   367 Gbits/sec                  receiver

hev-socks5-server

  1. version hev-socks5-server 2.7.0
  2. repository: https://github.com/heiher/hev-socks5-server
  3. Command
# workers: 16
hev-socks5-server conf/main.yml
  • Upload
$ proxychains iperf3 -c 127.0.0.1
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.01  sec   167 GBytes   143 Gbits/sec    1            sender
[  5]   0.00-10.05  sec   167 GBytes   143 Gbits/sec                  receiver

```bash $ proxychains iperf3 -c 127.0.0.1 -P 10


[ ID] Interval Transfer Bitrate Retr [ 9] 0.00-10.01 sec 57.2 GBytes 49.1 Gbits/sec 0 sender [ 9] 0.00-10.04 sec 57.2 GBytes 49.0 Gbits/sec receiver [ 11] 0.00-10.01 sec 55.9 GBytes 48.0 Gbits/sec 0 sender [ 11] 0.00-10.04 sec 55.9 GBytes 47.8 Gbits/sec receiver [ 13] 0.00-10.01 sec 30.6 GBytes 26.2 Gbits/sec 1 sender [ 13] 0.00-10.04 sec 30.6 GBytes 26.1 Gbits/sec receiver [ 15] 0.00-10.01 sec 31.4 GBytes 26.9 Gbits/sec 0 sender [ 15] 0.00-10.04 sec 31.4 GBytes 26.8 Gbits/sec receiver [ 17] 0.00-10.01 sec 57.0 GBytes 49.0 Gbits/sec 1 sender [ 17] 0.00-10.04 sec 57.0

Extension points exported contracts — how you extend this code

StreamOperation (Interface)
(no doc) [8 implementers]
src/server/socks/proto.rs
Server (Interface)
The [`Server`] trait defines a common interface for starting HTTP and SOCKS5 servers. This trait is intended to be impl [3 …
src/server.rs
AsyncStreamOperation (Interface)
(no doc) [8 implementers]
src/server/socks/proto.rs
Acceptor (Interface)
Trait for connection acceptors that handle incoming TCP streams. [2 implementers]
src/server.rs
Auth (Interface)
Trait for SOCKS authentication methods. [3 implementers]
src/server/socks/auth.rs
Accept (Interface)
An asynchronous function to modify io stream and service. [2 implementers]
src/server/http/accept.rs

Core symbols most depended-on inside this repo

as_ref
called by 12
src/server/socks/conn/associate.rs
len
called by 11
src/server/socks/proto/udp.rs
shutdown
called by 9
src/server/socks/conn.rs
assign_ipv6_from_extension
called by 7
src/connect.rs
write_to_async_stream
called by 7
src/server/socks/proto.rs
assign_ipv4_from_extension
called by 6
src/connect.rs
copy_bidirectional
called by 5
src/io.rs
accept
called by 5
src/server/http.rs

Shape

Method 201
Function 42
Class 41
Enum 19
Interface 6

Languages

Rust100%

Modules by API surface

src/connect.rs39 symbols
src/server/socks/conn/associate.rs32 symbols
src/server/socks/conn/bind.rs23 symbols
src/server/socks/conn/connect.rs19 symbols
src/server/socks/conn.rs18 symbols
src/server/socks/proto/address.rs14 symbols
src/server/http.rs12 symbols
src/server/socks/proto/handshake/password/response.rs10 symbols
src/server/http/tls.rs10 symbols
src/ext.rs10 symbols
src/daemon.rs10 symbols
src/server/socks/auth.rs9 symbols

For agents

$ claude mcp add vproxy \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact