ginuerzh d6868c17b5 fix(sniffing): keep the dial's route on the HTTP record
HandleHTTP records each request on a clone of the caller's recorder object
taken before the upstream dial, but the chain writes the flow's hops onto the
caller's object while it dials. The clone therefore never carried a path:
every HTTP flow was recorded as if it had been dialled directly.

A consumer that classifies a flow by its path, as wisper's split request
history does, showed tunnelled flows as direct -- and because a keep-alive
connection only gains the hops when the caller records the connection at
close, a long-lived flow stayed "direct" for its whole life.

Refresh Path/Chain/Route from the caller's object right after each dial, on a
fresh slice so the clone cannot rewrite the caller's own hops.
2026-12-04 02:04:30 +00:00
2026-10-21 09:08:58 +00:00
2026-07-29 22:39:19 +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
Extended (may be experimental) features outside the main gost tree.
Readme MIT
6.7 MiB
0 Stars 4 Watchers 0 Forks
Languages
Go 100%