client

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProxyClient

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

ProxyClient manages client-side proxy connections

func NewProxyClient

func NewProxyClient(tnet *netstack.Net, serverIP string, clientIP string, bufferSize int) *ProxyClient

NewProxyClient creates a new proxy client

func (*ProxyClient) AddRouteMapping

func (pc *ProxyClient) AddRouteMapping(localAddr string, remotePort int)

AddRouteMapping adds a route mapping configuration

func (*ProxyClient) CheckServerAvailability

func (pc *ProxyClient) CheckServerAvailability() error

CheckServerAvailability checks if the server is available by sending a heartbeat

func (*ProxyClient) Cleanup

func (pc *ProxyClient) Cleanup() error

Cleanup removes all port mappings from the server

func (*ProxyClient) IsShuttingDown

func (pc *ProxyClient) IsShuttingDown() bool

IsShuttingDown returns true if the client is shutting down due to server failure

func (*ProxyClient) Start

func (pc *ProxyClient) Start() error

Start starts all route listeners and registers them with the server

func (*ProxyClient) Wait

func (pc *ProxyClient) Wait()

Wait waits for all route listeners to finish

func (*ProxyClient) WaitForShutdownSignal

func (pc *ProxyClient) WaitForShutdownSignal() <-chan struct{}

WaitForShutdownSignal waits for either manual shutdown signal or server death

type RouteMapping

type RouteMapping struct {
	LocalAddr  string // Format: ip:port (e.g., "127.0.0.1:8080")
	RemotePort int    // Port to expose on server
	ClientPort int    // Random port client listens on
}

RouteMapping represents a local to remote port mapping

func ParseRouteMappings

func ParseRouteMappings(routeFlags []string) ([]RouteMapping, error)

ParseRouteMappings parses route mapping strings in format "local_ip:local_port-remote_port"

Jump to

Keyboard shortcuts

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