smux

package
v0.0.0-...-409b1ef Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const SupportedSMuxVersion = 2

Variables

This section is empty.

Functions

func ClientMuxer

func ClientMuxer(conn net.Conn, clientParams *muxedsocket.ClientParams) (muxedsocket.MuxedSocket, error)

ClientMuxer dials the target server and establishes a connection. If clientParams.TLSConfig is not nil, a TLS layer is added on top of the connection, else not.

func ServerMuxer

func ServerMuxer(listener net.Listener, params *muxedsocket.ServerParams) (muxedsocket.MuxedListener, error)

ServerMuxer takes unencrypted stream-oriented connection-based "listener" and adds TLS and multiplexing. If params.TLSConfig is nil, TLS won't be added.

Types

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

func (*Conn) AcceptStream

func (c *Conn) AcceptStream() (stream muxedsocket.MuxStream, err error)

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) LocalAddr

func (c *Conn) LocalAddr() net.Addr

func (*Conn) OpenStream

func (c *Conn) OpenStream() (stream muxedsocket.MuxStream, err error)

func (*Conn) RemoteAddr

func (c *Conn) RemoteAddr() net.Addr

type Listener

type Listener struct {
	// contains filtered or unexported fields
}

func (*Listener) Accept

func (l *Listener) Accept() (socket muxedsocket.Socket, err error)

func (*Listener) Addr

func (l *Listener) Addr() net.Addr

func (*Listener) Close

func (l *Listener) Close() error

type Stream

type Stream struct {
	// contains filtered or unexported fields
}

func (*Stream) Close

func (s *Stream) Close() error

func (*Stream) LocalAddr

func (s *Stream) LocalAddr() net.Addr

func (*Stream) Read

func (s *Stream) Read(b []byte) (n int, err error)

func (*Stream) RemoteAddr

func (s *Stream) RemoteAddr() net.Addr

func (*Stream) SetDeadline

func (s *Stream) SetDeadline(t time.Time) error

func (*Stream) SetReadDeadline

func (s *Stream) SetReadDeadline(t time.Time) error

func (*Stream) SetWriteDeadline

func (s *Stream) SetWriteDeadline(t time.Time) error

func (*Stream) StreamID

func (s *Stream) StreamID() int

func (*Stream) Write

func (s *Stream) Write(b []byte) (n int, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL