Skip to content

Add proxy protocol auto-detection #52

Description

@francomano

Description

Add a check that auto-detects the proxy protocol by probing the proxy server with SOCKS5, SOCKS4, and HTTP CONNECT greetings. Users often don't know what type of proxy they're behind, and misconfiguration is the #1 cause of "proxy doesn't work."

sing-box and xray-core auto-detect proxy types. proxychains-ng users frequently misconfigure proxy types (issue #246).

Codebase starting point

  • core/adapters/socks.go — SOCKS4/SOCKS5 protocol implementations, shows greeting byte sequences
  • core/adapters/http_proxy.go — HTTP/HTTPS CONNECT implementation
  • core/adapters/factory.goAdapterFactory switch on proxy type
  • core/checks/register.go — where to register the new check

Acceptance Criteria

  • Create core/checks/proxy_fingerprint/check.go implementing check.Checker
  • Send a SOCKS5 greeting (05 01 00) and analyze response
  • Send a SOCKS4 greeting and analyze response
  • Send an HTTP CONNECT request and analyze response
  • Identify which protocol the proxy actually speaks
  • If proxy type was user-specified, validate it matches actual behavior
  • Suggest the correct type if mismatch detected
  • No dependencies (standalone check)
  • Register in core/checks/register.go
  • Add unit tests in core/checks/proxy_fingerprint/check_test.go
  • Update README.md checks table

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions