bridge

package
v0.30.4 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2025 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ServerTcpEnable  = false
	ServerKcpEnable  = false
	ServerQuicEnable = false
	ServerTlsEnable  = false
	ServerWsEnable   = false
	ServerWssEnable  = false
	ServerSecureMode = false
)
View Source
var ClientSelectMode = Primary

Functions

func IsReplay added in v0.27.0

func IsReplay(key string) bool

func SetClientSelectMode added in v0.30.3

func SetClientSelectMode(v any) error

Types

type Bridge

type Bridge struct {
	TunnelPort int
	Client     *sync.Map
	Register   *sync.Map

	OpenTask    chan *file.Tunnel
	CloseTask   chan *file.Tunnel
	CloseClient chan int
	SecretChan  chan *conn.Secret
	// contains filtered or unexported fields
}

func NewTunnel

func NewTunnel(tunnelPort int, tunnelType string, ipVerify bool, runList *sync.Map, disconnectTime int) *Bridge

func (*Bridge) DelClient

func (s *Bridge) DelClient(id int)

func (*Bridge) GetHealthFromClient

func (s *Bridge) GetHealthFromClient(id int, c *conn.Conn)

GetHealthFromClient get health information form client

func (*Bridge) IsServer added in v0.30.4

func (s *Bridge) IsServer() bool

func (*Bridge) SendLinkInfo

func (s *Bridge) SendLinkInfo(clientId int, link *conn.Link, t *file.Tunnel) (target net.Conn, err error)

func (*Bridge) StartTunnel

func (s *Bridge) StartTunnel() error

type Client

type Client struct {
	Id int

	Version string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(id int, t, f *nps_mux.Mux, s *conn.Conn, vs string) *Client

func (*Client) AddFile added in v0.30.3

func (c *Client) AddFile(f *nps_mux.Mux)

func (*Client) AddSignal added in v0.30.3

func (c *Client) AddSignal(s *conn.Conn)

func (*Client) AddTunnel added in v0.30.3

func (c *Client) AddTunnel(t *nps_mux.Mux)

func (*Client) Close added in v0.30.3

func (c *Client) Close() error

func (*Client) GetFile added in v0.30.3

func (c *Client) GetFile() *nps_mux.Mux

func (*Client) GetSignal added in v0.30.3

func (c *Client) GetSignal() *conn.Conn

func (*Client) GetTunnel added in v0.30.3

func (c *Client) GetTunnel() *nps_mux.Mux

func (*Client) IsClosed added in v0.30.3

func (c *Client) IsClosed() bool

func (*Client) SwitchFile added in v0.30.3

func (c *Client) SwitchFile()

func (*Client) SwitchSignal added in v0.30.3

func (c *Client) SwitchSignal()

func (*Client) SwitchTunnel added in v0.30.3

func (c *Client) SwitchTunnel()

type SelectMode added in v0.30.3

type SelectMode int32
const (
	Primary SelectMode = iota
	RoundRobin
	Random
)

Jump to

Keyboard shortcuts

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