Documentation
¶
Overview ¶
Package transparent provides a transparent HTTP proxy implementation that forwards requests to a destination without modifying them.
Index ¶
- type TransparentProxy
- func (*TransparentProxy) ForwardResponseToClients(_ context.Context, _ jsonrpc2.Message) error
- func (*TransparentProxy) GetMessageChannel() chan jsonrpc2.Message
- func (*TransparentProxy) GetResponseChannel() <-chan jsonrpc2.Message
- func (p *TransparentProxy) IsRunning(_ context.Context) (bool, error)
- func (*TransparentProxy) SendMessageToDestination(_ jsonrpc2.Message) error
- func (*TransparentProxy) SendResponseMessage(_ jsonrpc2.Message) error
- func (p *TransparentProxy) Start(_ context.Context) error
- func (p *TransparentProxy) Stop(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TransparentProxy ¶
type TransparentProxy struct {
// contains filtered or unexported fields
}
TransparentProxy implements the Proxy interface as a transparent HTTP proxy that forwards requests to a destination. It's used by the SSE transport to forward requests to the container's HTTP server.
func NewTransparentProxy ¶
func NewTransparentProxy( port int, containerName string, targetURI string, middlewares ...types.Middleware, ) *TransparentProxy
NewTransparentProxy creates a new transparent proxy with optional middlewares.
func (*TransparentProxy) ForwardResponseToClients ¶
ForwardResponseToClients forwards a response from the destination to clients. This is not used in the TransparentProxy implementation as it forwards HTTP requests directly.
func (*TransparentProxy) GetMessageChannel ¶
func (*TransparentProxy) GetMessageChannel() chan jsonrpc2.Message
GetMessageChannel returns the channel for messages to/from the destination. This is not used in the TransparentProxy implementation as it forwards HTTP requests directly.
func (*TransparentProxy) GetResponseChannel ¶
func (*TransparentProxy) GetResponseChannel() <-chan jsonrpc2.Message
GetResponseChannel returns the channel for receiving messages from the destination. This is not used in the TransparentProxy implementation as it forwards HTTP requests directly.
func (*TransparentProxy) IsRunning ¶
func (p *TransparentProxy) IsRunning(_ context.Context) (bool, error)
IsRunning checks if the proxy is running.
func (*TransparentProxy) SendMessageToDestination ¶
func (*TransparentProxy) SendMessageToDestination(_ jsonrpc2.Message) error
SendMessageToDestination sends a message to the destination. This is not used in the TransparentProxy implementation as it forwards HTTP requests directly.
func (*TransparentProxy) SendResponseMessage ¶
func (*TransparentProxy) SendResponseMessage(_ jsonrpc2.Message) error
SendResponseMessage sends a message to the response channel. This is not used in the TransparentProxy implementation as it forwards HTTP requests directly.