proxy

package
v0.0.0-...-5c79d48 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProxiedMetricConn

type ProxiedMetricConn struct {
	net.Conn
	// contains filtered or unexported fields
}

ProxiedMetricConn wraps net.Conn opened by the Router so that the proxiedSessions counter can be decremented when it is closed.

func NewProxiedMetricConn

func NewProxiedMetricConn(conn net.Conn) *ProxiedMetricConn

NewProxiedMetricConn increments proxiedSessions and creates a ProxiedMetricConn that defers to the provided net.Conn.

func (*ProxiedMetricConn) Close

func (c *ProxiedMetricConn) Close() error

type RemoteClusterGetter

type RemoteClusterGetter interface {
	// GetRemoteCluster returns a remote cluster by name
	GetRemoteCluster(clusterName string) (types.RemoteCluster, error)
}

RemoteClusterGetter provides access to remote cluster resources

type Router

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

Router is used by the proxy to establish connections to both nodes and other clusters.

func NewRouter

func NewRouter(cfg RouterConfig) (*Router, error)

NewRouter creates and returns a Router that is populated from the provided RouterConfig.

func (*Router) DialHost

func (r *Router) DialHost(ctx context.Context, clientSrcAddr, clientDstAddr net.Addr, host, port, clusterName string, accessChecker services.AccessChecker, agentGetter teleagent.Getter, signer agentless.SignerCreator) (_ net.Conn, err error)

DialHost dials the node that matches the provided host, port and cluster. If no matching node is found an error is returned. If more than one matching node is found and the cluster networking configuration is not set to route to the most recent an error is returned.

func (*Router) DialSite

func (r *Router) DialSite(ctx context.Context, clusterName string, clientSrcAddr, clientDstAddr net.Addr) (_ net.Conn, err error)

DialSite establishes a connection to the auth server in the provided cluster. If the clusterName is an empty string then a connection to the local auth server will be established.

func (*Router) GetSiteClient

func (r *Router) GetSiteClient(ctx context.Context, clusterName string) (auth.ClientI, error)

GetSiteClient returns an auth client for the provided cluster.

type RouterConfig

type RouterConfig struct {
	// ClusterName indicates which cluster the router is for
	ClusterName string
	// Log is the logger to use
	Log *logrus.Entry
	// AccessPoint is the proxy cache
	RemoteClusterGetter RemoteClusterGetter
	// SiteGetter allows looking up sites
	SiteGetter SiteGetter
	// TracerProvider allows tracers to be created
	TracerProvider oteltrace.TracerProvider
	// contains filtered or unexported fields
}

RouterConfig contains all the dependencies required by the Router

func (*RouterConfig) CheckAndSetDefaults

func (c *RouterConfig) CheckAndSetDefaults() error

CheckAndSetDefaults ensures the required items were populated

type SiteGetter

type SiteGetter interface {
	// GetSite returns the site matching the provided clusterName
	GetSite(clusterName string) (reversetunnelclient.RemoteSite, error)
}

SiteGetter provides access to connected local or remote sites

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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