Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BadRequest ¶
type BadRequest struct {
// contains filtered or unexported fields
}
BadRequest is returned when extraction of the vhost name fails
type ClientHelloMsg ¶
type Closed ¶
type Closed struct {
// contains filtered or unexported fields
}
Closed is returned when the underlying connection is closed
type HTTPConn ¶
func HTTP ¶
HTTP parses the head of the first HTTP request on conn and returns a new, unread connection with metadata for virtual host muxing
type HTTPMuxer ¶
type HTTPMuxer struct {
*VhostMuxer
}
func NewHTTPMuxer ¶
NewHTTPMuxer begins muxing HTTP connections on the given listener by inspecting the HTTP Host header in new connections.
func (*HTTPMuxer) HandleErrors ¶
func (m *HTTPMuxer) HandleErrors()
HandleErrors handles muxing errors by calling .NextError(). You must invoke this function if you do not want to handle the errors yourself.
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
Listener is returned by a call to Listen() on a muxer. A Listener only receives connections that were made to the name passed into the muxer's Listen call.
Listener implements the net.Listener interface, so you can Accept() new connections and Close() it when finished. When you Close() a Listener, the parent muxer will stop listening for connections to the Listener's name.
func (*Listener) Accept ¶
Accept returns the next mux'd connection for this listener and blocks until one is available.
type NotFound ¶
type NotFound struct {
// contains filtered or unexported fields
}
NotFound is returned when a vhost is not found
type TLSConn ¶
type TLSConn struct { ClientHelloMsg *ClientHelloMsg // contains filtered or unexported fields }
A Conn represents a secured connection. It implements the net.Conn interface.
type TLSMuxer ¶
type TLSMuxer struct {
*VhostMuxer
}
func NewTLSMuxer ¶
NewTLSMuxer begins muxing TLS connections by inspecting the SNI extension.
func (*TLSMuxer) HandleErrors ¶
func (m *TLSMuxer) HandleErrors()
HandleErrors is the default error handler for TLS muxers. At the moment, it simply closes connections which are invalid or destined for virtual host names that it is not listening for. You must invoke this function if you do not want to handle the errors yourself.
type VhostMuxer ¶
type VhostMuxer struct { sync.RWMutex // protects the registry // contains filtered or unexported fields }