Documentation ¶
Overview ¶
Package mux implements a qmux session and channel API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Listener ¶
type Listener interface { // Close closes the listener. // Any blocked Accept operations will be unblocked and return errors. Close() error // Accept waits for and returns the next incoming session. Accept() (Session, error) // Addr returns the listener's network address if available. Addr() net.Addr }
A Listener is similar to a net.Listener but returns connections wrapped as mux sessions.
func ListenIO ¶
func ListenIO(out io.WriteCloser, in io.ReadCloser) (Listener, error)
ListenIO returns an IOListener that gives a mux session based on seperate WriteCloser and ReadClosers.
func ListenStdio ¶
ListenStdio is a convenience for calling ListenIO with Stdout and Stdin.
func ListenUnix ¶
ListenTCP creates a Unix domain socket listener at the given path.
func ListenWS ¶
ListenWS takes a TCP address and returns a Listener for a HTTP+WebSocket server listening on the given address.
func ListenerFrom ¶
type Session ¶
type Session interface { io.Closer Accept() (Channel, error) Open(ctx context.Context) (Channel, error) Wait() error }
Session is a bi-directional channel muxing session on a given transport.
func DialIO ¶
func DialIO(out io.WriteCloser, in io.ReadCloser) (Session, error)
DialIO establishes a mux session using a WriterCloser and ReadCloser.
func DialWS ¶
DialWS establishes a mux session via WebSocket connection. The address must be a host and port. Opening a WebSocket connection at a particular path is not supported.
func New ¶
func New(t io.ReadWriteCloser) Session
NewSession returns a session that runs over the given transport.