Documentation ¶
Index ¶
Constants ¶
View Source
const ( HeaderError = "X-Error" HeaderAction = "X-Action" HeaderForwardedHost = "X-Forwarded-Host" HeaderForwardedProto = "X-Forwarded-Proto" )
Protocol HTTP headers.
View Source
const ( HTTP = "http" HTTPS = "https" TCP = "tcp" TCP4 = "tcp4" TCP6 = "tcp6" UNIX = "unix" SNI = "sni" )
Known protocol types.
View Source
const (
ActionProxy = "proxy"
)
Known actions.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ControlMessage ¶
type ControlMessage struct { Action string ForwardedHost string ForwardedProto string RemoteAddr string }
ControlMessage is sent from server to client before streaming data. It's used to inform client about the data and action to take. Based on that client routes requests to backend services.
func ReadControlMessage ¶
func ReadControlMessage(r *http.Request) (*ControlMessage, error)
ReadControlMessage reads ControlMessage from HTTP headers.
func (*ControlMessage) WriteToHeader ¶
func (c *ControlMessage) WriteToHeader(h http.Header)
WriteToHeader writes ControlMessage to HTTP header.
type Tunnel ¶
type Tunnel struct { // Protocol specifies tunnel protocol, must be one of protocols known // by the server. Protocol string // Host specified HTTP request host, it's required for HTTP and WS // tunnels. Host string // Auth specifies HTTP basic auth credentials in form "user:password", // if set server would protect HTTP and WS tunnels with basic auth. Auth string // Addr specifies TCP address server would listen on, it's required // for TCP tunnels. Addr string }
Tunnel describes a single tunnel between client and server. When connecting client sends tunnels to server. If client gets connected server proxies connections to given Host and Addr to the client.
Click to show internal directories.
Click to hide internal directories.