How snail007/goproxy works
GoProxy is a multi-protocol proxy and tunneling server. The principal workflow is a client request entering a configured proxy service, being parsed or forwarded, optionally routed through a parent proxy, and relayed to a destination. The graph includes the HTTP routing/authentication stages, TCP and UDP forwarding, and tunnel endpoints. README capabilities such as SOCKS5, WebSocket, load balancing, and protocol conversion are documented but their implementations are not identifiable from the sampled source, so they are represented only as a documented feature area under services/.
Main entry points: http.go HTTP proxy · service.go Service registry · serve-channel.go Network listeners · tcp.go TCP proxy
Components 18
Startup and control
- Process entry
main.go - CLI configuration
config.go - Service registry
services/service.go
Proxy services
- HTTP proxy
services/http.go - TCP proxy
services/tcp.go - UDP proxy
services/udp.go - Documented protocols
services
Tunnel services
- Tunnel client
services/tunnel_client.go - Tunnel server
services/tunnel_server.go - Tunnel bridge
services/tunnel_bridge.go - UDP work queue
services/tunnel_server.go
Runtime utilities
- Network listeners
utils/serve-channel.go - HTTP parsing and auth
utils/structs.go - Domain routing checks
utils/structs.go - Connection utilities
utils/functions.go
Other components
- Proxy client
- Target service
- Parent proxy
Connections 36
- Process entry → CLI configuration: loads configuration
- CLI configuration → Service registry: registers and runs
- Process entry → Service registry: cleans service
- Service registry → HTTP proxy: starts service
- Service registry → TCP proxy: starts service
- Service registry → UDP proxy: starts service
- Service registry → Tunnel client: starts service
- Service registry → Tunnel server: starts service
- Service registry → Tunnel bridge: starts service
- Proxy client → HTTP proxy: sends requests
- Proxy client → TCP proxy: opens connection
- Proxy client → UDP proxy: sends datagrams
- HTTP proxy → Network listeners: opens listener
- TCP proxy → Network listeners: opens listener
- UDP proxy → Network listeners: opens listener
- Network listeners → HTTP proxy: dispatches requests
- Network listeners → TCP proxy: dispatches connections
- Network listeners → UDP proxy: dispatches datagrams
- HTTP proxy → HTTP parsing and auth: parses and authenticates
- HTTP proxy → Domain routing checks: checks destination
- HTTP proxy → Connection utilities: connects and relays
- HTTP proxy → Parent proxy: forwards via parent
- HTTP proxy → Target service: forwards directly
- TCP proxy → Connection utilities: connects and relays
- TCP proxy → Parent proxy: forwards via parent
- TCP proxy → Target service: forwards to target
- UDP proxy → Parent proxy: forwards via parent
- UDP proxy → Target service: forwards datagrams
- Tunnel client → Parent proxy: opens TLS tunnel
- Tunnel client → Target service: relays to local target
- Tunnel server → Parent proxy: opens TLS tunnel
- Tunnel server → Network listeners: listens for tunnel traffic
- Tunnel server → UDP work queue: queues UDP packets
- UDP work queue → Parent proxy: sends tunneled packets
- Tunnel bridge → Network listeners: bridges traffic
- Documented protocols → HTTP proxy: includes documented modes