Documentation ¶
Index ¶
- Variables
- type Conn
- type Manager
- type Router
- func (r *Router) AddHTTPTLSConfig(sniHost string, config *tls.Config)
- func (r *Router) AddTCPRoute(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 ¶
var ( PostgresStartTLSMsg = []byte{0, 0, 0, 8, 4, 210, 22, 47} // int32(8) + int32(80877103) PostgresStartTLSReply = []byte{83} // S )
Functions ¶
This section is empty.
Types ¶
type Conn ¶
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 ¶
type Router struct {
// contains filtered or unexported fields
}
Router is a TCP router.
func (*Router) AddHTTPTLSConfig ¶
AddHTTPTLSConfig defines a handler for a given sniHost and sets the matching tlsConfig.
func (*Router) AddTCPRoute ¶
AddTCPRoute defines a handler for the given rule.
func (*Router) GetConn ¶
func (r *Router) GetConn(conn tcp.WriteCloser, peeked string) tcp.WriteCloser
GetConn creates a connection proxy with a peeked string.
func (*Router) GetHTTPHandler ¶
GetHTTPHandler gets the attached http handler.
func (*Router) GetHTTPSHandler ¶
GetHTTPSHandler gets the attached https handler.
func (*Router) GetTLSGetClientInfo ¶
GetTLSGetClientInfo is called after a ClientHello is received from a client.
func (*Router) ServeTCP ¶
func (r *Router) ServeTCP(conn tcp.WriteCloser)
ServeTCP forwards the connection to the right TCP/HTTP handler.
func (*Router) SetHTTPForwarder ¶
SetHTTPForwarder sets the tcp handler that will forward the connections to an http handler.
func (*Router) SetHTTPHandler ¶
SetHTTPHandler attaches http handlers on the router.
func (*Router) SetHTTPSForwarder ¶
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.