Documentation ¶
Index ¶
- type Conn
- type Manager
- type Router
- func (r *Router) AddHTTPTLSConfig(sniHost string, config *tls.Config)
- func (r *Router) AddRoute(rule string, priority int, target tcp.Handler) error
- func (r *Router) GetConn(conn tcp.WriteCloser, peeked string) tcp.WriteCloser
- func (r *Router) GetHTTPHandler() http.Handler
- func (r *Router) GetHTTPSHandler() http.Handler
- func (r *Router) GetTLSGetClientInfo() func(info *tls.ClientHelloInfo) (*tls.Config, error)
- func (r *Router) ServeTCP(conn tcp.WriteCloser)
- func (r *Router) SetHTTPForwarder(handler tcp.Handler)
- func (r *Router) SetHTTPHandler(handler http.Handler)
- func (r *Router) SetHTTPSForwarder(handler tcp.Handler)
- func (r *Router) SetHTTPSHandler(handler http.Handler, config *tls.Config)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶ added in v2.7.0
type Conn struct { // Peeked are the bytes that have been read from Conn for the purposes of route matching, // but have not yet been consumed by Read calls. // It set to nil by Read when fully consumed. Peeked []byte // Conn is the underlying connection. // It can be type asserted against *net.TCPConn or other types as needed. // It should not be read from directly unless Peeked is nil. tcp.WriteCloser }
Conn is a connection proxy that handles Peeked bytes.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is a route/router manager.
func NewManager ¶
func NewManager(conf *runtime.Configuration, serviceManager *tcpservice.Manager, middlewaresBuilder middlewareBuilder, httpHandlers map[string]http.Handler, httpsHandlers map[string]http.Handler, tlsManager *traefiktls.Manager, ) *Manager
NewManager Creates a new Manager.
type Router ¶ added in v2.7.0
type Router struct {
// contains filtered or unexported fields
}
Router is a TCP router.
func (*Router) AddHTTPTLSConfig ¶ added in v2.7.0
AddHTTPTLSConfig defines a handler for a given sniHost and sets the matching tlsConfig.
func (*Router) GetConn ¶ added in v2.7.0
func (r *Router) GetConn(conn tcp.WriteCloser, peeked string) tcp.WriteCloser
GetConn creates a connection proxy with a peeked string.
func (*Router) GetHTTPHandler ¶ added in v2.7.0
GetHTTPHandler gets the attached http handler.
func (*Router) GetHTTPSHandler ¶ added in v2.7.0
GetHTTPSHandler gets the attached https handler.
func (*Router) GetTLSGetClientInfo ¶ added in v2.7.0
GetTLSGetClientInfo is called after a ClientHello is received from a client.
func (*Router) ServeTCP ¶ added in v2.7.0
func (r *Router) ServeTCP(conn tcp.WriteCloser)
ServeTCP forwards the connection to the right TCP/HTTP handler.
func (*Router) SetHTTPForwarder ¶ added in v2.7.0
SetHTTPForwarder sets the tcp handler that will forward the connections to an http handler.
func (*Router) SetHTTPHandler ¶ added in v2.7.0
SetHTTPHandler attaches http handlers on the router.
func (*Router) SetHTTPSForwarder ¶ added in v2.7.0
SetHTTPSForwarder sets the tcp handler that will forward the TLS connections to an HTTP handler. It also sets up each TLS handler (with its TLS config) for each Host(SNI) rule we previously kept track of. It sets up a special handler that closes the connection if a TLS config is nil.