Documentation ¶
Overview ¶
Package http_dialer provides HTTP(S) CONNECT tunneling net.Dialer. It allows you to establish arbitrary TCP connections (as long as your proxy allows them) through a HTTP(S) CONNECT point.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HttpConnectTunnel ¶
type HttpConnectTunnel struct {
// contains filtered or unexported fields
}
HttpConnectTunnel represents a configured HTTP Connect Tunnel dialer.
func New ¶
New constructs an HttpConnectTunnel to be used a net.Dial command. The first parameter is a proxy URL, for example https://foo.example.com:9090 will use foo.example.com as proxy on port 9090 using TLS for connectivity.
func (HttpConnectTunnel) Dial ¶
Dial is an implementation of net.Dialer, and returns a TCP connection handle to the host that HTTP CONNECT reached.
func (HttpConnectTunnel) DialContext ¶
type ProxyAuthorization ¶
type ProxyAuthorization interface { // Type represents what kind of Authorization, e.g. "Bearer", "Token", "Digest". Type() string // Initial allows you to specify an a-priori "Proxy-Authenticate" response header, attached to first request, // so you don't need to wait for an additional challenge. If empty string is returned, "Proxy-Authenticate" // header is added. InitialResponse() string // ChallengeResponse returns the content of the "Proxy-Authenticate" response header, that has been chose as // response to "Proxy-Authorization" request header challenge. ChallengeResponse(challenge string) string }
ProxyAuthorization allows for plugging in arbitrary implementations of the "Proxy-Authorization" handler.
func AuthBasic ¶
func AuthBasic(username string, password string) ProxyAuthorization
AuthBasic returns a ProxyAuthorization that implements "Basic" protocol while ignoring realm challenges.