client

package
v0.33.12 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: GPL-3.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const MaxPad = 64

Variables

View Source
var AutoReconnect = true
View Source
var DisableP2P = false
View Source
var HasFailed = false
View Source
var NowStatus int
View Source
var P2PMode = common.CONN_QUIC
View Source
var QuicConfig = &quic.Config{
	KeepAlivePeriod:    10 * time.Second,
	MaxIdleTimeout:     30 * time.Second,
	MaxIncomingStreams: 100000,
}
View Source
var SkipTLSVerify = false
View Source
var TlsCfg = &tls.Config{
	InsecureSkipVerify: true,
	ServerName:         crypt.GetFakeDomainName(),
	NextProtos:         []string{"h3"},
}

Functions

func EnsurePort

func EnsurePort(server string, tp string) string

func GetProxyConn added in v0.33.12

func GetProxyConn(proxyUrl, server string, timeout time.Duration) (rawConn net.Conn, err error)

func GetTaskStatus

func GetTaskStatus(server string, vKey string, tp string, proxyUrl string)

func NewConn

func NewConn(tp string, vkey string, server string, proxyUrl string) (*conn.Conn, string, error)

NewConn Create a new connection with the server and verify it

func NewHttpProxyConn

func NewHttpProxyConn(proxyURL *url.URL, remoteAddr string, timeout time.Duration) (net.Conn, error)

NewHttpProxyConn http proxy connection

func RegisterLocalIp

func RegisterLocalIp(server string, vKey string, tp string, proxyUrl string, hour int)

func SendType added in v0.33.12

func SendType(c *conn.Conn, connType, uuid string) error

func StartFromFile

func StartFromFile(pCtx context.Context, pCancel context.CancelFunc, path string)

func VerifyState added in v0.33.12

func VerifyState(state tls.ConnectionState, host string) (fingerprint []byte, verified bool)

func VerifyTLS

func VerifyTLS(connection net.Conn, host string) (fingerprint []byte, verified bool)

Types

type Closer

type Closer interface{ Close() error }

type FileServerManager

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

func NewFileServerManager

func NewFileServerManager(parentCtx context.Context) *FileServerManager

func (*FileServerManager) CloseAll

func (fsm *FileServerManager) CloseAll()

func (*FileServerManager) GetListenerByKey added in v0.33.12

func (fsm *FileServerManager) GetListenerByKey(key string) (*conn.VirtualListener, bool)

func (*FileServerManager) StartFileServer

func (fsm *FileServerManager) StartFileServer(t *file.Tunnel, vkey string)

type HealthChecker

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

func NewHealthChecker

func NewHealthChecker(parentCtx context.Context, healths []*file.Health, c *conn.Conn) *HealthChecker

func (*HealthChecker) Reset

func (hc *HealthChecker) Reset()

func (*HealthChecker) Start

func (hc *HealthChecker) Start()

func (*HealthChecker) Stop

func (hc *HealthChecker) Stop()

type P2PManager

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

func NewP2PManager

func NewP2PManager(pCtx context.Context, pCancel context.CancelFunc, cfg *config.CommonConfig) *P2PManager

func (*P2PManager) Close

func (mgr *P2PManager) Close()

func (*P2PManager) StartLocalServer

func (mgr *P2PManager) StartLocalServer(l *config.LocalServer) error

type P2pBridge added in v0.33.12

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

func NewP2pBridge added in v0.33.12

func NewP2pBridge(mgr *P2PManager, l *config.LocalServer) *P2pBridge

func (*P2pBridge) CliProcess added in v0.33.12

func (b *P2pBridge) CliProcess(*conn.Conn, string)

func (*P2pBridge) IsServer added in v0.33.12

func (b *P2pBridge) IsServer() bool

func (*P2pBridge) SendLinkInfo added in v0.33.12

func (b *P2pBridge) SendLinkInfo(_ int, link *conn.Link, _ *file.Tunnel) (net.Conn, error)

type TRPClient

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

func NewRPClient

func NewRPClient(svrAddr, vKey, bridgeConnType, proxyUrl, uuid string, cnf *config.Config, disconnectTime int, fsm *FileServerManager) *TRPClient

NewRPClient new client

func (*TRPClient) Close

func (s *TRPClient) Close()

func (*TRPClient) Start

func (s *TRPClient) Start(ctx context.Context)

Jump to

Keyboard shortcuts

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