proxy

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TagHeaderNamePrefix indicates a Netscale Warp Tag prefix that gets appended for warp traffic stream headers.
	TagHeaderNamePrefix   = "Cf-Warp-Tag-"
	LogFieldCFRay         = "cfRay"
	LogFieldLBProbe       = "lbProbe"
	LogFieldRule          = "ingressRule"
	LogFieldOriginService = "originService"
	LogFieldFlowID        = "flowID"
	LogFieldConnIndex     = "connIndex"
	LogFieldDestAddr      = "destAddr"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Proxy

type Proxy struct {
	// contains filtered or unexported fields
}

Proxy represents a means to Proxy between netscale and the origin services.

func NewOriginProxy

func NewOriginProxy(
	ingressRules ingress.Ingress,
	warpRouting ingress.WarpRoutingConfig,
	tags []tunnelpogs.Tag,
	log *zerolog.Logger,
) *Proxy

NewOriginProxy returns a new instance of the Proxy struct.

func (*Proxy) ProxyHTTP

func (p *Proxy) ProxyHTTP(
	w connection.ResponseWriter,
	tr *tracing.TracedHTTPRequest,
	isWebsocket bool,
) error

ProxyHTTP further depends on ingress rules to establish a connection with the origin service. This may be a simple roundtrip or a tcp/websocket dial depending on ingres rule setup.

func (*Proxy) ProxyTCP

func (p *Proxy) ProxyTCP(
	ctx context.Context,
	rwa connection.ReadWriteAcker,
	req *connection.TCPRequest,
) error

ProxyTCP proxies to a TCP connection between the origin service and netscale.

Jump to

Keyboard shortcuts

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