Documentation
¶
Overview ¶
Package tcptunnel contains an implementation of a TCP tunnel via HTTP Connect.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*config)
An Option modifies the config.
func WithBrowserCommand ¶
WithBrowserCommand returns an option to configure the browser command.
func WithDestinationHost ¶
WithDestinationHost returns an option to configure the destination host.
func WithJWTCache ¶
WithJWTCache returns an option to configure the jwt cache.
func WithProxyHost ¶
WithProxyHost returns an option to configure the proxy host.
func WithTLSConfig ¶
WithTLSConfig returns an option to configure the tls config.
type Tunnel ¶
type Tunnel struct {
// contains filtered or unexported fields
}
A Tunnel represents a TCP tunnel over HTTP Connect.
func (*Tunnel) Run ¶
func (tun *Tunnel) Run(ctx context.Context, local io.ReadWriter, evt TunnelEvents) error
Run establishes a TCP tunnel via HTTP Connect and forwards all traffic from/to local.
type TunnelEvents ¶
type TunnelEvents interface { // OnConnecting is called when listener is accepting a new connection from client OnConnecting(context.Context) // OnConnected is called when a connection is successfully // established to the remote destination via pomerium proxy OnConnected(context.Context) // OnAuthRequired is called after listener accepted a new connection from client, // but has to perform user authentication first OnAuthRequired(context.Context, string) // OnDisconnected is called when connection to client was closed OnDisconnected(context.Context, error) }
TunnelEvents is used to notify on the tunnel state transition
func DiscardEvents ¶
func DiscardEvents() TunnelEvents
DiscardEvents returns a broadcaster that discards all events