Documentation
¶
Overview ¶
Package proxyfront pkg/proxyfront/proxyfront.go
One listener, two proxy protocols. The resolving proxies speak SOCKS5; this lets the same port also answer HTTP proxy requests (CONNECT and absolute-URL requests), which is what an OS-level HTTP proxy setting — Android's VpnService.Builder.setHttpProxy, a browser's "HTTP proxy" field — speaks. A connection whose first byte is the SOCKS5 version goes to the SOCKS5 server; anything else is handled as HTTP through the same dial path, so .dmsg, .skynet, the status pages and the upstream rules behave identically.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ServeConn ¶ added in v1.3.99
ServeConn applies the same protocol split to one already-accepted connection, for a caller with no listener to wrap: the resolvers' in-process local-service path, where a conn arrives over net.Pipe rather than from Accept. The conn is handed to serveSOCKS5 or serveHTTP, and closed here only when its first byte never arrives.
Types ¶
type DialFunc ¶
DialFunc opens a connection to host:port the way the proxy's SOCKS5 server would for a CONNECT to that name.
func SOCKSDial ¶
func SOCKSDial(resolver socks5.NameResolver, dial func(ctx context.Context, network, addr string) (net.Conn, error)) DialFunc
SOCKSDial builds a DialFunc from a SOCKS5 server's resolver and dial callback, taking the steps go-socks5 takes for a CONNECT: resolve a name (which is where the resolving proxies record the original hostname), then dial the resolved address.