镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Local SOCKS5 proxy (CONNECT) #10

Closed

Description

@compot-dev
  • SOCKS5 server on 127.0.0.1 on top of lwIP raw TCP: CONNECT, IPv4 destinations only.
  • Reject ATYP 3 (domain, no DNS in the stack) and ATYP 4 (IPv6) with proper reply codes; reject BIND/UDP ASSOCIATE.
  • Reject destinations without a route via the tunnel (DHCP client with option 121/249 and route table #5) and connections before an address is bound.
  • Optional RFC 1929 username/password (any local process can otherwise use the proxy).
  • Flow control between the local socket and the lwIP PCB (no unbounded buffering).
  • Acceptance: curl --socks5 127.0.0.1:<port> http://<device behind the server>/.

Activity

  1. compot-dev commented on Oct 13, 2026

    @compot-dev
    CollaboratorAuthor

    Done in ab5ab5c (netcore/proxy.c).

    Bench acceptance (bench/bench.sh proxy-test, 16/16, also clean under ASan/UBSan with leak detection and on big-endian MIPS unit tests):

    • SOCKS5 CONNECT → HTTP 200; IPv4 literal in the domain field accepted; host name → 8, IPv6 → 8, no route → 3, closed port → 5
    • curl --socks5 OK
    • forward: 20 MiB download sha256 OK (~110–140 MiB/s), 8 MiB TCP echo both directions intact (~70–100 MiB/s), RTSP OPTIONS OK, forward to a closed port closes the local connection
    • 8 parallel 20 MiB downloads via SOCKS5 intact (~55 MiB/s total with curl)
    • SOCKS5 user/password: no-auth client gets 0xFF, wrong password refused, correct one works
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions