MCPcopy Index your code
hub / github.com/cfal/shoes

github.com/cfal/shoes @v0.2.7

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.2.7 ↗ · + Follow
2,502 symbols 7,175 edges 179 files 610 documented · 24%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

shoes

shoes is a high-performance multi-protocol proxy server written in Rust.

Supported Protocols

Proxy Protocols

  • HTTP/HTTPS
  • SOCKS5 (with UDP ASSOCIATE)
  • Mixed (auto-detect HTTP/SOCKS5)
  • VMess AEAD
  • VLESS (with fallback support)
  • Shadowsocks
  • Trojan
  • Snell v3
  • Hysteria2
  • TUIC v5
  • AnyTLS
  • NaiveProxy
  • H2MUX (supported with VMess, VLESS, Trojan, Shadowsocks, Snell)

Transport Protocols

All server protocols plus: - SagerNet UDP over TCP (for Shadowsocks, SOCKS5, AnyTLS, NaiveProxy) - ShadowTLS v3 - TLS - WebSocket (Shadowsocks SIP003) - XTLS Reality - XTLS Vision (for VLESS)

TUN/VPN Mode

  • TUN device support - Layer 3 VPN for transparent proxying
  • Supported platforms: Linux, Android, iOS

Supported Ciphers

  • VMess: aes-128-gcm, chacha20-poly1305, none
  • Shadowsocks: aes-128-gcm, aes-256-gcm, chacha20-ietf-poly1305, 2022-blake3-aes-128-gcm, 2022-blake3-aes-256-gcm, 2022-blake3-chacha20-ietf-poly1305
  • Snell v3: aes-128-gcm, aes-256-gcm, chacha20-ietf-poly1305

Features

  • Multi-transport: TCP or QUIC for all protocols
  • TLS with SNI routing: Route by Server Name Indication
  • Upstream proxy chaining: Multi-hop chains with load balancing
  • Rule-based routing: Route by IP/CIDR or hostname masks
  • Named PEM certificates: Define once, reference everywhere
  • TLS fingerprint authentication: Certificate pinning for TLS/QUIC
  • Hot reloading: Apply config changes without restart
  • Unix socket support: Bind to Unix domain sockets

For advanced access control (IP allowlist/blocklists), see tobaru.

Installation

Precompiled binaries for x86_64 and Apple aarch64 are available on Github Releases.

Or install with cargo:

cargo install shoes

Usage

shoes [OPTIONS] <config.yaml> [config.yaml...]

OPTIONS:
    -t, --threads NUM    Set the number of worker threads (default: CPU count)
    -d, --dry-run        Parse the config and exit
    --no-reload          Disable automatic config reloading on file changes

COMMANDS:
    generate-reality-keypair                  Generate a new Reality X25519 keypair
    generate-shadowsocks-2022-password <cipher>    Generate a Shadowsocks password

Examples

# Run with a single config file
shoes config.yaml

# Run with multiple config files
shoes server1.yaml server2.yaml rules.yaml

# Run with custom thread count
shoes --threads 8 config.yaml

# Validate configuration without starting
shoes --dry-run config.yaml

# Run without hot-reloading
shoes --no-reload config.yaml

# Generate Reality keypair
shoes generate-reality-keypair

# Generate Shadowsocks 2022 cipher password
shoes generate-shadowsocks-2022-password 2022-blake3-aes-256-gcm

Configuration

See CONFIG.md for the complete YAML configuration reference.

Examples

See the examples directory for all examples.

Basic VMess Server

- address: 0.0.0.0:16823
  protocol:
    type: vmess
    cipher: chacha20-poly1305
    user_id: b0e80a62-8a51-47f0-91f1-f0f7faf8d9d4
    udp_enabled: true

VLESS with Vision over TLS

- address: 0.0.0.0:443
  protocol:
    type: tls
    tls_targets:
      "vless.example.com":
        cert: cert.pem
        key: key.pem
        vision: true
        alpn_protocols: ["http/1.1"]
        protocol:
          type: vless
          user_id: b85798ef-e9dc-46a4-9a87-8da4499d36d0
          udp_enabled: true

Reality Server

- address: 0.0.0.0:443
  protocol:
    type: tls
    reality_targets:
      "www.example.com":
        private_key: "YOUR_BASE64URL_PRIVATE_KEY"
        short_ids: ["0123456789abcdef", ""]
        dest: "www.example.com:443"
        protocol:
          type: vless
          user_id: b85798ef-e9dc-46a4-9a87-8da4499d36d0
          udp_enabled: true

Reality Client

- address: 127.0.0.1:1080
  protocol:
    type: socks
  rules:
    - masks: "0.0.0.0/0"
      action: allow
      client_chain:
        address: "server.example.com:443"
        protocol:
          type: reality
          public_key: "SERVER_PUBLIC_KEY"
          short_id: "0123456789abcdef"
          sni_hostname: "www.example.com"
          protocol:
            type: vless
            user_id: b85798ef-e9dc-46a4-9a87-8da4499d36d0

Hysteria2 Server

- address: 0.0.0.0:443
  transport: quic
  quic_settings:
    cert: cert.pem
    key: key.pem
    alpn_protocols: ["h3"]
  protocol:
    type: hysteria2
    password: supersecret
    udp_enabled: true

TUIC v5 Server

- address: 0.0.0.0:443
  transport: quic
  quic_settings:
    cert: cert.pem
    key: key.pem
  protocol:
    type: tuic
    uuid: d685aef3-b3c4-4932-9a9d-d0c2f6727dfa
    password: supersecret

Mixed HTTP/SOCKS5 Server

- address: 0.0.0.0:7890
  protocol:
    type: mixed
    username: myuser
    password: mypassword

AnyTLS Server

- address: 0.0.0.0:443
  protocol:
    type: tls
    tls_targets:
      "anytls.example.com":
        cert: cert.pem
        key: key.pem
        protocol:
          type: anytls
          users:
            - name: user1
              password: secret123
          udp_enabled: true

NaiveProxy Server

- address: 0.0.0.0:443
  protocol:
    type: tls
    tls_targets:
      "naive.example.com":
        cert: cert.pem
        key: key.pem
        alpn_protocols: ["h2"]
        protocol:
          type: naiveproxy
          users:
            - username: user1
              password: secret123
          padding: true

TUN VPN

- device_name: tun0
  address: 10.0.0.1
  netmask: 255.255.255.0
  mtu: 1500
  tcp_enabled: true
  udp_enabled: true
  rules:
    - masks: "0.0.0.0/0"
      action: allow
      client_chain:
        address: "proxy.example.com:443"
        protocol:
          type: tls
          protocol:
            type: vless
            user_id: b85798ef-e9dc-46a4-9a87-8da4499d36d0

Similar Projects

Extension points exported contracts — how you extend this code

AsyncTargetedMessageStream (Interface)
Server stream trait connected to proxy clients, where received messages have a target address, and we write forwarded me [5 …
src/async_stream.rs
TcpServerHandler (Interface)
(no doc) [12 implementers]
src/tcp/tcp_handler.rs
Resolver (Interface)
(no doc) [5 implementers]
src/resolver.rs
SocketProtector (Interface)
Socket protection callback for Android VPN. On Android, this trait is implemented by the app to call `VpnService.protec [3 …
src/tun/platform.rs
ShadowsocksKey (Interface)
(no doc) [3 implementers]
src/shadowsocks/shadowsocks_key.rs
VmessHash (Interface)
(no doc) [2 implementers]
src/vmess/sha2.rs
AsyncPing (Interface)
(no doc) [32 implementers]
src/async_stream.rs
TcpClientHandler (Interface)
(no doc) [15 implementers]
src/tcp/tcp_handler.rs

Core symbols most depended-on inside this repo

len
called by 490
src/shadowsocks/default_key.rs
clone
called by 446
src/h2mux/h2mux_client_session.rs
extend_from_slice
called by 301
src/slide_buffer.rs
is_empty
called by 195
src/option_util.rs
map
called by 132
src/option_util.rs
len
called by 97
src/option_util.rs
judge
called by 88
src/client_proxy_selector.rs
insert
called by 87
src/anytls/anytls_types.rs

Shape

Function 1,121
Method 1,029
Class 251
Enum 74
Interface 27

Languages

Rust100%

Modules by API surface

src/client_proxy_selector.rs106 symbols
src/config/validate.rs70 symbols
src/config/types/server.rs61 symbols
src/client_proxy_chain.rs54 symbols
src/anytls/anytls_server_session.rs50 symbols
src/config/types/rules.rs48 symbols
src/vmess/vmess_stream.rs47 symbols
src/naiveproxy/naive_padding_stream.rs46 symbols
src/routing/udp_router.rs43 symbols
src/xudp/frame.rs38 symbols
src/reality/reality_records.rs37 symbols
src/vless/tls_deframer.rs33 symbols

For agents

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

⬇ download graph artifact