proxy

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAgentDialer

func NewAgentDialer(dialAgentFunc AgentDialFunc) gost.Dialer

func NewClientJwtAuthenticator

func NewClientJwtAuthenticator(tokenVerifier jwtutil.TokenVerifier) gost.Authenticator

func NewClientNoAuthAuthenticator

func NewClientNoAuthAuthenticator() gost.Authenticator

func RunLoadBalancerServer

func RunLoadBalancerServer(conf *config.LoadBalancerCmd)

func RunProxyServer

func RunProxyServer(conf *config.ProxyCmd)

func Tracer

func Tracer(connTrack *ConnTrack) func(_ context.Context, perspective logging.Perspective, connID quic.ConnectionID) *logging.ConnectionTracer

Types

type AgentDialFunc

type AgentDialFunc func(ctx context.Context, agentID AgentID) (net.Conn, error)

type AgentDialer

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

func (*AgentDialer) Dial

func (cd *AgentDialer) Dial(ctx context.Context, addr string, opts ...gost.DialerOption) (net.Conn, error)

type AgentID

type AgentID string

type ClientJwtAuthenticator

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

func (*ClientJwtAuthenticator) Authenticate

func (a *ClientJwtAuthenticator) Authenticate(ctx context.Context, agentID, password string, opts ...gost.AuthOption) (id string, ok bool)

type ClientNoAuthAuthenticator

type ClientNoAuthAuthenticator struct {
}

func (*ClientNoAuthAuthenticator) Authenticate

func (a *ClientNoAuthAuthenticator) Authenticate(ctx context.Context, agentID, password string, opts ...gost.AuthOption) (id string, ok bool)

type ConnTrack

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

func NewConnTrack

func NewConnTrack(storeClient store.Client, httpProxyAddress string) *ConnTrack

func (*ConnTrack) GetConn

func (ct *ConnTrack) GetConn(agentID AgentID) (previous quic.Connection, loaded bool)

func (*ConnTrack) OnConnClose

func (ct *ConnTrack) OnConnClose(connID string)

func (*ConnTrack) OnConnStarted

func (ct *ConnTrack) OnConnStarted(connID string)

func (*ConnTrack) PutConn

func (ct *ConnTrack) PutConn(agentID AgentID, conn quic.Connection) error

func (*ConnTrack) Shutdown

func (ct *ConnTrack) Shutdown()

type HttpProxyForwardAuth

type HttpProxyForwardAuth struct {
}

func NewHttpProxyForwardAuth

func NewHttpProxyForwardAuth() *HttpProxyForwardAuth

func (*HttpProxyForwardAuth) Auth

type HttpProxyServer

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

func NewHttpProxyServer

func NewHttpProxyServer(listenAddr string, tlsServerConfig certconfig.TLSServerConfig, dialAgentFunc AgentDialFunc, clientAuthenticator gost.Authenticator, bypass *util.Whitelist, forwardAuth bool) (*HttpProxyServer, error)

func (*HttpProxyServer) ListenAndServe

func (p *HttpProxyServer) ListenAndServe() error

func (*HttpProxyServer) Shutdown

func (p *HttpProxyServer) Shutdown(_ context.Context) error

type LoadBalancerDialer

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

func NewLoadBalancerDialer

func NewLoadBalancerDialer(storeClient store.Client, tlsConfigFunc tlsclient.TLSClientConfigFunc) *LoadBalancerDialer

func (*LoadBalancerDialer) Dial

func (lb *LoadBalancerDialer) Dial(ctx context.Context, agentID AgentID) (net.Conn, error)

type QuicServer

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

func NewQuicServer

func NewQuicServer(conf *config.ProxyCmd, agentVerifier agent.Verifier, connTrack *ConnTrack, logger *logger.Logger) *QuicServer

func (*QuicServer) Close

func (qs *QuicServer) Close()

func (*QuicServer) DialAgent

func (qs *QuicServer) DialAgent(ctx context.Context, agentID AgentID) (net.Conn, error)

type SyncedMap

type SyncedMap[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func NewSyncedMap

func NewSyncedMap[K comparable, V any]() *SyncedMap[K, V]

func (*SyncedMap[K, V]) CompareAndDelete

func (m *SyncedMap[K, V]) CompareAndDelete(key K, old V) bool

func (*SyncedMap[K, V]) CompareAndSwap

func (m *SyncedMap[K, V]) CompareAndSwap(key K, old V, new V) bool

func (*SyncedMap[K, V]) Delete

func (m *SyncedMap[K, V]) Delete(key K)

func (*SyncedMap[K, V]) Entries

func (m *SyncedMap[K, V]) Entries() ([]K, []V)

func (*SyncedMap[K, V]) Get

func (m *SyncedMap[K, V]) Get(key K) (V, bool)

func (*SyncedMap[K, V]) GetAndDelete

func (m *SyncedMap[K, V]) GetAndDelete(key K) (V, bool)

func (*SyncedMap[K, V]) Keys

func (m *SyncedMap[K, V]) Keys() []K

func (*SyncedMap[K, V]) Set

func (m *SyncedMap[K, V]) Set(key K, value V)

func (*SyncedMap[K, V]) Swap

func (m *SyncedMap[K, V]) Swap(key K, value V) (V, bool)

func (*SyncedMap[K, V]) Values

func (m *SyncedMap[K, V]) Values() []V

Jump to

Keyboard shortcuts

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