dialvia

package
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2024 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextDialerFunc

type ContextDialerFunc func(context context.Context, network, addr string) (net.Conn, error)

ContextDialerFunc is a function that implements Dialer and ContextDialer.

func (ContextDialerFunc) Dial

func (f ContextDialerFunc) Dial(network, addr string) (net.Conn, error)

Dial is needed to satisfy the proxy.Dialer interface. It is never called as proxy.ContextDialer is used instead if available.

func (ContextDialerFunc) DialContext

func (f ContextDialerFunc) DialContext(ctx context.Context, network, addr string) (net.Conn, error)

type HTTPProxyDialer

type HTTPProxyDialer struct {
	ConnectRequestModifier func(req *http.Request) error
	// contains filtered or unexported fields
}

func HTTPProxy

func HTTPProxy(dial ContextDialerFunc, proxyURL *url.URL) *HTTPProxyDialer

func HTTPSProxy

func HTTPSProxy(dial ContextDialerFunc, proxyURL *url.URL, tlsConfig *tls.Config) *HTTPProxyDialer

func (*HTTPProxyDialer) DialContext

func (d *HTTPProxyDialer) DialContext(ctx context.Context, network, addr string) (net.Conn, error)

func (*HTTPProxyDialer) DialContextR

func (d *HTTPProxyDialer) DialContextR(ctx context.Context, network, addr string) (*http.Response, net.Conn, error)

DialContextR is like DialContext but returns the HTTP response as well. The caller is responsible for closing the response body.

type SOCKS5ProxyDialer

type SOCKS5ProxyDialer struct {
	// contains filtered or unexported fields
}

func SOCKS5Proxy

func SOCKS5Proxy(dial ContextDialerFunc, proxyURL *url.URL) *SOCKS5ProxyDialer

func (*SOCKS5ProxyDialer) DialContext

func (d *SOCKS5ProxyDialer) DialContext(_ context.Context, network, addr string) (net.Conn, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL