Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // ListenFunc returns a net.Listener that listens for incoming source connections. ListenFunc func() (net.Listener, error) // DialFunc dials a remote and returns a net.Conn for the destination. DialFunc func() (net.Conn, error) }
Config holds the configuration for a single proxy connection between a source and destination.
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn represents a single proxied TCP connection.
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
Listener is the implementation of a specific proxy listener. It has pluggable Listen and Dial methods to suit public mTLS vs upstream semantics. It handles the lifecycle of the listener and all connections opened through it
func NewListener ¶
NewListener returns a Listener setup to listen for public mTLS connections and proxy them to the configured local application over TCP.
func (*Listener) Close ¶
func (l *Listener) Close()
Close terminates the listener and all active connections.
func (*Listener) Errors ¶
Errors returns a channel that the listener writes errors to. The channel is closed when the listener is closed.
func (*Listener) Listening ¶
func (l *Listener) Listening() <-chan struct{}
Listening returns a channel that is closed when the Listener is ready to accept incoming connections.
func (*Listener) Serve ¶
Serve runs the listener until it is stopped. It is an error to call Serve more than once for any given Listener instance.
Serve returns a non-nil error if the Listener is unable to accept any incoming connections. Errors related to individual connections are written to the Errors() channel.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server implements a proxy server that manages TCP listeners for a configurable set of upstreams.
func New ¶
New returns a new, unstarted proxy server from the given proxy configurations. The proxy can be started by calling Serve.
func (*Server) Close ¶
func (s *Server) Close()
Close shuts down the proxy and closes all active connections and listeners.