Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
Handler responds to a TCP request.
ServeTCP should write responses to the in connection and close it on return.
type HandlerFunc ¶
type Proxy ¶
type Proxy struct { // DialTimeout sets the timeout for establishing the outbound // connection. DialTimeout time.Duration // Lookup returns a target host for the given request. // The proxy will panic if this value is nil. Lookup func(host string) *route.Target // Conn counts the number of connections. Conn metrics.Counter // ConnFail counts the failed upstream connection attempts. ConnFail metrics.Counter // Noroute counts the failed Lookup() calls. Noroute metrics.Counter }
Proxy implements a generic TCP proxying handler.
type SNIProxy ¶
type SNIProxy struct { // DialTimeout sets the timeout for establishing the outbound // connection. DialTimeout time.Duration // Lookup returns a target host for the given server name. // The proxy will panic if this value is nil. Lookup func(host string) *route.Target // Conn counts the number of connections. Conn metrics.Counter // ConnFail counts the failed upstream connection attempts. ConnFail metrics.Counter // Noroute counts the failed Lookup() calls. Noroute metrics.Counter }
SNIProxy implements an SNI aware transparent TCP proxy which captures the TLS client hello, extracts the host name and uses it for finding the upstream server. Then it replays the ClientHello message and copies data transparently allowing to route a TLS connection based on the SNI header without decrypting it.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.