tlslistener

package
v0.24.9 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	TLSAddresses []string
	TCPAddresses []string
}

func (*Config) Apply

func (c *Config) Apply(ctx context.Context, l *ListenersHandler) error

type ContextConnextion

type ContextConnextion struct {
	net.Conn
	context.Context
	CloseFunc func() error
}

func (ContextConnextion) Close

func (c ContextConnextion) Close() error

func (ContextConnextion) GetContext

func (c ContextConnextion) GetContext() context.Context

type ListenersHandler

type ListenersHandler struct {
	GetCertificate        func(*tls.ClientHelloInfo) (*tls.Certificate, error)
	ListenersForHandleTLS []net.Listener // listener which will handle TLS

	// listeners which will not handle TLS, but will proxy to self listener. It is comfortable for listen https and http
	// ports and translate it to one proxy
	Listeners []net.Listener

	NextProtos []string
	// contains filtered or unexported fields
}

func (*ListenersHandler) Accept

func (p *ListenersHandler) Accept() (net.Conn, error)

Implement net.Listener

func (*ListenersHandler) Addr

func (p *ListenersHandler) Addr() net.Addr

func (*ListenersHandler) Close

func (p *ListenersHandler) Close() error

func (*ListenersHandler) GetConnectionContext

func (p *ListenersHandler) GetConnectionContext(remoteAddr, localAddr string) (context.Context, error)

func (*ListenersHandler) Start

func (p *ListenersHandler) Start(ctx context.Context) error

Block until finish work (by context or start error) It can stop by cancel context. Now StartAutoRenew return immedantly after cancel context - without wait to finish background processes. It can change in future.

Jump to

Keyboard shortcuts

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