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 { // UserClientIp is the user's client IP UserClientIp net.IP // ClientAddress is the remote address (IP and port) of the client. If // there are any load balancers or proxies between the user and the worker, // then it will be the address of the last one before the worker. ClientAddress *net.TCPAddr ClientConn *websocket.Conn RemoteEndpoint string Session session.Session 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 WithInjectedApplicationCredentials ¶ added in v0.10.0
func WithInjectedApplicationCredentials(creds []*serverpb.Credential) Option
WithInjectedApplicationCredentials provides an optional injected application credentials to use when establishing a proxy