Documentation ¶
Index ¶
- Constants
- func FromURLBy(u *url.URL, forward proxy.Dialer) (proxy.Dialer, error)
- func FromURLWithConfig(u *url.URL, forward proxy.Dialer, cfg *Config) (proxy.Dialer, error)
- func GeneratorWithConfig(cfg *Config) base.SchemeDialerGenerator
- func RegisterProxyDialer(proxyConfig *Config)
- type BaseConfig
- type Config
Constants ¶
const ( DefaultDiaTimeout = 1 * time.Second DefaultWSHeartInterval = 30 * time.Second )
time duration consts.
const ( SchemeHTTP = "http" SchemeHTTPS = "https" SchemeWebsocket = "ws" SchemeWebsocketSec = "wss" )
Schemes
Variables ¶
This section is empty.
Functions ¶
func FromURLBy ¶
FromURLBy returns a proxy.Dialer given a URL specification and an underlying proxy.Dialer for it to make network requests. FromURL may be passed to proxy.RegisterDialerType for the schemes "http" and "https". The convenience function RegisterDialerFromURL simplifies this.
func FromURLWithConfig ¶
FromURLWithConfig is like New, but allows control over various options.
func GeneratorWithConfig ¶
func GeneratorWithConfig(cfg *Config) base.SchemeDialerGenerator
GeneratorWithConfig is like ConnectFromURLWithConfig, but is suitable for passing to proxy.RegisterDialerType while maintaining configuration options.
This is to enable registration of an http(s) proxy with options, e.g.:
proxy.RegisterDialerType("https", myproxy.GeneratorWithConfig( &myproxy.Config{DialTimeout: 5 * time.Minute}, ))
func RegisterProxyDialer ¶
func RegisterProxyDialer(proxyConfig *Config)
RegisterProxyDialer register proxy dialer for http/https/ws/wss schemes.
Types ¶
type BaseConfig ¶
type BaseConfig struct { TLSClientConfig *tls.Config // tls client config for https|wss Header http.Header // http addon header DialTimeout time.Duration // proxy dial timeout }
BaseConfig for proxy.
type Config ¶
type Config struct { Base BaseConfig WSHeartInterval time.Duration // websocket part: interval for websocket send ping package to keep alive. HTTPMethod string // http part: which method to use for dialing, default: CONNECT. }
Config for proxy.
func DefaultConfig ¶
DefaultConfig return default config for common using, tls will skip tls verify.
Directories ¶
Path | Synopsis |
---|---|
Package connect implement proxy.Dialer(s) with http connect method.
|
Package connect implement proxy.Dialer(s) with http connect method. |
Package post implement proxy.Dialer(s) with http post method.
|
Package post implement proxy.Dialer(s) with http post method. |