Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
Conn represents a proxy connection
func (*Conn) PeekClientHello ¶
func (pc *Conn) PeekClientHello() (*tls.ClientHelloInfo, error)
PeekClientHello attempts to read TLS ClientHello from the connection without consuming the TLS handshake.
func (*Conn) WriteHeader ¶
WriteHeader writes an HTTP status header to the proxy client. It must be called before any writes to ProxyConn otherwise http.StatusOK is written.
type Handler ¶
type Handler struct { // Tunneler specifies the mechanism for handling HTTP CONNECT // tunnels. Tunneler Tunneler // NonConnect is used for all other HTTP requests where HTTP method != CONNECT NonConnect http.Handler }
A Handler implements http.Handler for running a proxy.
type Tunneler ¶
type Tunneler interface { // Tunnel opens a tunnel for a given request // between clientConn and the target addr Tunnel(ctx context.Context, clientConn *Conn, network, addr string) }
Tunneler is an interface representing the ability to handle a single HTTP CONNECT request by opening a tunnel for a given Request.
type TunnelerFunc ¶
The TunnelerFunc type is an adapter to allow the use of an ordinary function as a tunneler.
Click to show internal directories.
Click to hide internal directories.