tlsmux

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrListenerClosed = errors.New("listener closed")

Functions

func Client

func Client(netconn net.Conn, config *tls.Config, proto string) *tls.Conn

func Dial

func Dial(network, address string, config *tls.Config, proto string) (net.Conn, error)

func DialTimeout

func DialTimeout(network, address string, to time.Duration, config *tls.Config, proto string) (net.Conn, error)

func Listen

func Listen(network, address string, config *tls.Config, protos ...string) (net.Listener, error)

Listen starts a new listener on the given network, address and protocol using a shared multiplexer.

Types

type Listener

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

Listener is the original listener that multiplexes connections to sublisteners.

func ListenMux

func ListenMux(network, address string) (*Listener, error)

ListenMux starts a new listener on the given network and address.

func NewMuxListener

func NewMuxListener(listener net.Listener) *Listener

NewMuxListener creates a new TLS multiplexing listener.

func (*Listener) Addr

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

Addr returns the listener's network address.

func (*Listener) Close

func (mx *Listener) Close() error

Close closes the listener.

func (*Listener) GetConfigForClient

func (mx *Listener) GetConfigForClient(hello *tls.ClientHelloInfo) (config *tls.Config, err error)

GetConfigForClient returns the configuration for the given client hello. This is called by the tls package to resolve the configuration for a new connection.

func (*Listener) Listen

func (mx *Listener) Listen(config *tls.Config, protos ...string) (net.Listener, error)

Listen creates a new sublistener for the given protocol and configuration.

Jump to

Keyboard shortcuts

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