tlstunnel

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2025 License: MIT Imports: 23 Imported by: 0

README

tlstunnel

A TLS reverse proxy.

  • Automatic TLS with Let's Encrypt
  • Route incoming connections to backends using Server Name Indication
  • Support for the PROXY protocol

Example configuration:

frontend example.org:443 {
    backend localhost:8080
}

See the man page for more information.

Contributing

Send patches on Codeberg, report bugs on the issue tracker. Discuss in #emersion on Libera Chat.

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	Network      string
	Address      string
	Proxy        bool
	ProxyVersion int
	TLSConfig    *tls.Config // nil if no TLS
}

type Frontend

type Frontend struct {
	Backend    Backend
	Protocols  []string
	ClientAuth tls.ClientAuthType
	ClientCAs  *x509.CertPool
}

type Listener

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

func (*Listener) Listen

func (ln *Listener) Listen() error

func (*Listener) RegisterFrontend

func (ln *Listener) RegisterFrontend(name string, fe *Frontend) error

func (*Listener) Start

func (ln *Listener) Start()

func (*Listener) Stop

func (ln *Listener) Stop() error

func (*Listener) UpdateFrom

func (ln *Listener) UpdateFrom(new *Listener) *Listener

type Server

type Server struct {
	Listeners map[string]*Listener // indexed by listening address
	Frontends []*Frontend
	Debug     bool

	Names          []string
	ManagedNames   []string
	UnmanagedCerts []tls.Certificate

	ACMEIssuer *certmagic.ACMEIssuer
	ACMEConfig *certmagic.Config
	// contains filtered or unexported fields
}

func NewServer

func NewServer() *Server

func (*Server) Load

func (srv *Server) Load(filename string) error

func (*Server) RegisterListener

func (srv *Server) RegisterListener(addr string) *Listener

func (*Server) Replace

func (srv *Server) Replace(old *Server) error

Replace starts the server but takes over existing listeners from an old Server instance. The old instance keeps running unchanged if Replace returns an error.

func (*Server) Start

func (srv *Server) Start() error

func (*Server) Stop

func (srv *Server) Stop()

Directories

Path Synopsis
cmd
tlstunnel command

Jump to

Keyboard shortcuts

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