ginuerzh 39580f04ca fix(handler/socks5): RFC 1928 compliance — method negotiation, BND.ADDR, UDP ordering, and safe type assertions
- selector.go: Select() now only returns methods the client actually offered,
  defaulting to MethodNoAcceptable (0xFF) when no mutually-supported method
  exists. Prevents protocol desync when authenticator is set but client
  doesn't offer UserPass. (#1, #2)

- connect.go: CONNECT success reply now carries the outbound connection's
  actual local address as BND.ADDR per RFC 1928 §6, instead of 0.0.0.0:0. (#4)

- udp.go: UDP ASSOCIATE now verifies the upstream chain is reachable before
  sending Success to the client; on failure sends a proper Failure reply.
  Also adds safe type assertions for net.TCPAddr and net.UDPAddr to prevent
  panics on wrapped connections, and returns errors on DNS resolution failure
  instead of silently dropping datagrams. (#5, #1, #2, #3)
2026-06-25 15:41:15 +08:00
2026-06-13 12:36:09 +08:00
2022-03-14 20:27:50 +08:00

x

The implementation layer for the GOST proxy framework. Every interface defined in core/ is implemented here — handlers, listeners, dialers, connectors, plus config parsing, registries, and all cross-cutting concerns.

Package layout

Directory Purpose
handler/ Protocol handlers (http, socks4/5, ss, ssh, tunnel, tun, dns, redirect, etc.)
listener/ Protocol listeners (tcp, tls, ws, http2/3, quic, kcp, icmp, tun, udp, etc.)
dialer/ Outbound dialers (tcp, tls, ws, http2/3, quic, grpc, ssh, wg, kcp, icmp, etc.)
connector/ Destination connectors (http, socks4/5, ss, ssh, relay, tunnel, direct, etc.)
config/ Config struct, YAML/JSON parsing, and service construction
registry/ Typed global registries for all component types
service/ Accept loop wiring listener + handler
chain/ Multi-hop forwarding chain and route implementation
router/ Route table router (destination-based routing)
hop/ Node group with load-balanced selection
selector/ Load-balancing strategies (round-robin, random, weighted, hash)
auth/, bypass/, admission/ Authentication, bypass rules, admission control
resolver/, hosts/ DNS resolution and host mapping
limiter/ Traffic, connection, and rate limiters
recorder/, observer/ Traffic recording and observability
ingress/, sd/, routing/ Ingress control, service discovery, routing rules
logger/, metrics/, api/ Logging, Prometheus metrics, Web API
metadata/, ctx/ Metadata key-value system and context propagation
internal/ Shared internals — not importable externally

Component pattern

Every handler, listener, dialer, and connector follows the same pattern: init() registers a constructor into a global registry, the constructor takes functional options, and Init(metadata.Metadata) extracts typed configuration from the metadata key-value map.

See CLAUDE.md for detailed architecture and conventions.

S
Description
No description provided
Readme 8 MiB
Languages
Go 100%