proto

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2021 License: BSD-3-Clause Imports: 2 Imported by: 2

Documentation

Index

Constants

View Source
const (
	HeaderAction       = "T-Action"
	HeaderError        = "T-Error"
	HeaderForwardedBy  = "T-Forwarded-By"
	HeaderForwardedFor = "T-Forwarded-For"
	HeaderPath         = "T-Path"
	HeaderProtocol     = "T-Proto"
)

Protocol HTTP headers.

View Source
const (
	HTTP = "http"
	TCP  = "tcp"
	TCP4 = "tcp4"
	TCP6 = "tcp6"
	UNIX = "unix"
	WS   = "ws"
)

Known protocol types.

View Source
const (
	ActionProxy string = "proxy"
)

Known actions.

Variables

This section is empty.

Functions

This section is empty.

Types

type ControlMessage

type ControlMessage struct {
	Action       string
	Protocol     string
	ForwardedFor string
	ForwardedBy  string
	Path         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(h http.Header) (*ControlMessage, error)

ReadControlMessage reads ControlMessage from HTTP headers.

func (*ControlMessage) Update

func (c *ControlMessage) Update(h http.Header)

Update 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL