Documentation ¶
Index ¶
- type ConfigWatcher
- type LeafCertSpec
- type Manager
- type Option
- func WithBasicAuth(auth *config.BasicAuth) Option
- func WithCert(cert *tls.Certificate) Option
- func WithDefaultApplication(t string) Option
- func WithDefaultFilter(f string) Option
- func WithDefaultPriority(priority commonv1.Priority) Option
- func WithDefaultTag(t string) Option
- func WithDumpHTTPContent(dump bool) Option
- func WithHTTPSHosts(hosts ...*config.HijackHost) Option
- func WithMaxConcurrency(con int64) Option
- func WithPeerHost(peerHost *schedulerv1.PeerHost) Option
- func WithPeerIDGenerator(peerIDGenerator peer.IDGenerator) Option
- func WithPeerSearcher(peerSearcher pex.PeerSearchBroadcaster) Option
- func WithPeerTaskManager(peerTaskManager peer.TaskManager) Option
- func WithRegistryMirror(r *config.RegistryMirror) Option
- func WithRules(rules []*config.ProxyRule) Option
- func WithWhiteList(whiteList []*config.WhiteList) Option
- type Proxy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigWatcher ¶ added in v2.0.5
type ConfigWatcher interface {
Watch(*config.ProxyOption)
}
type LeafCertSpec ¶
type LeafCertSpec struct {
// contains filtered or unexported fields
}
type Manager ¶
type Manager interface { ConfigWatcher Serve(net.Listener) error ServeSNI(net.Listener) error Stop() error IsEnabled() bool }
func NewProxyManager ¶
func NewProxyManager(peerHost *schedulerv1.PeerHost, peerTaskManager peer.TaskManager, peerExchange pex.PeerExchangeServer, proxyOption *config.ProxyOption) (Manager, error)
type Option ¶
Option is a functional option for configuring the proxy
func WithBasicAuth ¶
WithBasicAuth sets basic auth info for proxy
func WithDefaultApplication ¶ added in v2.0.6
WithDefaultApplication sets default tag for http requests without X-Dragonfly-Application Header
func WithDefaultFilter ¶
WithDefaultFilter sets default filter for http requests without X-Dragonfly-Filter Header
func WithDefaultPriority ¶ added in v2.0.9
WithDefaultPriority sets default priority for http requests without X-Dragonfly-Priority Header
func WithDefaultTag ¶ added in v2.0.5
WithDefaultTag sets default tag for http requests without X-Dragonfly-Tag Header
func WithDumpHTTPContent ¶ added in v2.0.1
func WithHTTPSHosts ¶
func WithHTTPSHosts(hosts ...*config.HijackHost) Option
WithHTTPSHosts sets the rules for hijacking https requests
func WithMaxConcurrency ¶
WithMaxConcurrency sets max concurrent for process http request
func WithPeerHost ¶
func WithPeerHost(peerHost *schedulerv1.PeerHost) Option
WithPeerHost sets the *schedulerv1.PeerHost
func WithPeerIDGenerator ¶ added in v2.0.2
func WithPeerIDGenerator(peerIDGenerator peer.IDGenerator) Option
WithPeerIDGenerator sets the *transport.PeerIDGenerator
func WithPeerSearcher ¶ added in v2.1.40
func WithPeerSearcher(peerSearcher pex.PeerSearchBroadcaster) Option
func WithPeerTaskManager ¶
func WithPeerTaskManager(peerTaskManager peer.TaskManager) Option
WithPeerTaskManager sets the peer.PeerTaskManager
func WithRegistryMirror ¶
func WithRegistryMirror(r *config.RegistryMirror) Option
WithRegistryMirror sets the registry mirror for the proxy
func WithWhiteList ¶
WithWhiteList sets the proxy whitelist
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
Proxy is a http proxy handler. It proxies requests with dragonfly if any defined proxy rules is matched