connection

package
v0.35.6 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: GPL-3.0 Imports: 17 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure added in v0.35.0

func Configure(n servercfg.NetworkConfig)

Configure sets the listener settings without opening anything.

func InitConnectionService

func InitConnectionService() error

InitConnectionService loads the listener settings and, when several listeners share the bridge port, opens the port multiplexer on it.

func IsHTTP added in v0.35.0

func IsHTTP(b []byte) bool

IsHTTP reports whether b starts like an HTTP request.

func Listen added in v0.35.0

func Listen(k Kind) (net.Listener, error)

Listen opens the listener of kind k on its configured address, or takes its share of the port multiplexer when it sits on the bridge port.

func Network added in v0.35.0

func Network() servercfg.NetworkConfig

Network returns the listener settings nps started with.

Types

type Kind added in v0.35.0

type Kind int

Kind names one of the listeners nps opens on its configured ports.

const (
	KindBridgeTCP Kind = iota
	KindBridgeTLS
	KindBridgeWS
	KindBridgeWSS
	KindHTTP
	KindHTTPS
	KindWeb

	// KindMix is the mixed port, never on the port multiplexer.
	KindMix = kindCount + 1
)

func (Kind) String added in v0.35.0

func (k Kind) String() string

Jump to

Keyboard shortcuts

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