network

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: GPL-3.0 Imports: 13 Imported by: ? modules, 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 ACMETLSConfig

func ACMETLSConfig(domain, email, storageDir string) (*tls.Config, error)

ACMETLSConfig obtains (and thereafter auto-renews) a Let's Encrypt certificate for the given domain using the HTTP-01 challenge, and returns a *tls.Config ready to wrap a listener with tls.NewListener.

HTTP-01 requires TCP port 80 to be free and reachable from the internet: certmagic's HTTP solver transiently binds :80 for the duration of each challenge (issuance and renewal), then releases it. TLS-ALPN is disabled because the panel/sub servers do not necessarily listen on :443.

Certificates are persisted under storageDir so they survive restarts and we avoid re-issuing (which would otherwise hit Let's Encrypt rate limits).

func NewAutoHttpsConn

func NewAutoHttpsConn(conn net.Conn) net.Conn

func NewAutoHttpsListener

func NewAutoHttpsListener(listener net.Listener) net.Listener

func NewTLSConfig added in v1.5.4

func NewTLSConfig(certFile, keyFile, domain string) (*tls.Config, error)

Types

type AutoHttpsConn

type AutoHttpsConn struct {
	net.Conn
	// contains filtered or unexported fields
}

func (*AutoHttpsConn) Read

func (c *AutoHttpsConn) Read(buf []byte) (int, error)

type AutoHttpsListener

type AutoHttpsListener struct {
	net.Listener
}

func (*AutoHttpsListener) Accept

func (l *AutoHttpsListener) Accept() (net.Conn, error)

Jump to

Keyboard shortcuts

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