Documentation ¶
Overview ¶
Package proxy contains a collection of proxy handlers for the worker to call once a connection has been authorized. Each proxy handler should mark the connection as connected once the proxy has successfully been established.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrUnknownProtocol specifies the provided protocol has no registered handler ErrUnknownProtocol = errors.New("proxy: handler not found for protocol") // ErrProtocolAlreadyRegistered specifies the provided protocol has already been registered ErrProtocolAlreadyRegistered = errors.New("proxy: protocol already registered") )
Functions ¶
func RegisterHandler ¶
RegisterHandler registers the handler to call for the protocol. The protocol is negotiated when the connection was established to the worker.
func TestWsConn ¶
TestWsConn creates a websocket client and handler simulating the local websocket proxy created during Boundary connect. The proxyConn returned should be used as the connection passed into the worker proxy handler, while the clientConn can be used to simulate the local end user connection.
Types ¶
type Config ¶
type Config struct { ClientAddress *net.TCPAddr ClientConn *websocket.Conn RemoteEndpoint string SessionClient pbs.SessionServiceClient SessionInfo *session.Info ConnectionId string }
Config provides the core parameters needed for a worker to create a proxy between a provided ClientConn and the RemoteEndpoint, as well as the parameters to update the connection in the connection repository.
type Handler ¶
Handler is the type that all proxies need to implement to be called by the worker when a new client connection is created.
func GetHandler ¶
GetHandler returns the handler registered for the provided protocol. If the protocol is not registered nil and ErrUnknownProtocol is returned.
type Option ¶
type Option func(*Options)
Option - how Options are passed as arguments.
func WithEgressCredentials ¶ added in v0.6.2
func WithEgressCredentials(creds []credential.Credential) Option
WithEgressCredentials provides an optional egress credentials to use when establishing a proxy
type Options ¶ added in v0.6.2
type Options struct {
WithEgressCredentials []credential.Credential
}
Options = how options are represented