proxy

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Proxy

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

A Proxy listens to a port and forwards incoming connections to a router

func NewProxy

func NewProxy(c context.Context, router func(*net.TCPConn) (string, error)) (proxy *Proxy, err error)

NewProxy returns a new Proxy instance that is listening to the given tcp address

func (*Proxy) ListenerPort

func (pxy *Proxy) ListenerPort() (int, error)

ListenerPort returns the port that this proxy listens to

func (*Proxy) Run

func (pxy *Proxy) Run(c context.Context, limit int64)

Run starts the proxy accept loop and runs it until the context is cancelled. The limit argument limits the maximum number of connections that can be concurrently proxied. This limit prevents exhausting all available file descriptors when clients are greedy about opening connections. This was originally encountered with load testing clients. You might argue this is a bug in those clients, and you might be right, but without this limit it manifests in a far more confusing way as a bug in telepresence.

func (*Proxy) SetSocksPort added in v2.1.4

func (pxy *Proxy) SetSocksPort(socksPort int32)

SetSocksPort sets the port that the connector has assigned for dynamic ssh port forwarding

Jump to

Keyboard shortcuts

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