Documentation ¶
Index ¶
- Constants
- Variables
- type MatchFunc
- type Mux
- func (mux *Mux) DefaultListener() net.Listener
- func (mux *Mux) Listen(priority int, needBytesNum uint32, fn MatchFunc) net.Listener
- func (mux *Mux) ListenHTTP(priority int) net.Listener
- func (mux *Mux) ListenHTTPS(priority int) net.Listener
- func (mux *Mux) Serve() error
- func (mux *Mux) SetKeepAlive(keepAlive time.Duration)
Constants ¶
View Source
const ( // DefaultTimeout is the default length of time to wait for bytes we need. DefaultTimeout = 10 * time.Second )
Variables ¶
View Source
var ( HTTPSNeedBytesNum uint32 = 1 HTTPNeedBytesNum uint32 = 3 YamuxNeedBytesNum uint32 = 2 )
Functions ¶
This section is empty.
Types ¶
type MatchFunc ¶
var YamuxMatchFunc MatchFunc = func(data []byte) bool { if len(data) < int(YamuxNeedBytesNum) { return false } if data[0] == 0 && data[1] <= 0x3 { return true } return false }
YamuxMatchFunc is a match function for yamux. From https://github.com/hashicorp/yamux/blob/master/spec.md
type Mux ¶
type Mux struct {
// contains filtered or unexported fields
}
func (*Mux) DefaultListener ¶
func (*Mux) Serve ¶
Serve handles connections from ln and multiplexes then across registered listeners.
func (*Mux) SetKeepAlive ¶
Click to show internal directories.
Click to hide internal directories.