bridge

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: 24 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

func IsReplay(key string) bool

func SetClientSelectMode added in v0.33.12

func SetClientSelectMode(v any) error

Types

type Bridge

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

	VirtualTcpListener *conn.VirtualListener
	VirtualTlsListener *conn.VirtualListener
	VirtualWsListener  *conn.VirtualListener
	VirtualWssListener *conn.VirtualListener
	OpenHost           chan *file.Host
	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) CliProcess added in v0.33.12

func (s *Bridge) CliProcess(c *conn.Conn, tunnelType string)

func (*Bridge) DelClient

func (s *Bridge) DelClient(id int)

func (*Bridge) GetHealthFromClient

func (s *Bridge) GetHealthFromClient(id int, c *conn.Conn, client *Client, node *Node)

GetHealthFromClient get health information form client

func (*Bridge) IsServer added in v0.33.12

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
	LastUUID string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(id int, n *Node) *Client

func (*Client) AddFile added in v0.33.12

func (c *Client) AddFile(key, uuid string) error

func (*Client) AddNode added in v0.33.12

func (c *Client) AddNode(n *Node)

func (*Client) CheckNode added in v0.33.12

func (c *Client) CheckNode() *Node

func (*Client) Close added in v0.33.12

func (c *Client) Close() error

func (*Client) GetNode added in v0.33.12

func (c *Client) GetNode() *Node

func (*Client) GetNodeByFile added in v0.33.12

func (c *Client) GetNodeByFile(key string) (*Node, bool)

func (*Client) GetNodeByUUID added in v0.33.12

func (c *Client) GetNodeByUUID(uuid string) (*Node, bool)

func (*Client) IsClosed added in v0.33.12

func (c *Client) IsClosed() bool

func (*Client) NodeCount added in v0.33.12

func (c *Client) NodeCount() int

func (*Client) RemoveFile added in v0.33.12

func (c *Client) RemoveFile(key string)

func (*Client) RemoveOfflineNodes added in v0.33.12

func (c *Client) RemoveOfflineNodes() (removed int)

type IdleTimer added in v0.33.12

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

func NewIdleTimer added in v0.33.12

func NewIdleTimer(idle time.Duration, closeFn func()) *IdleTimer

func (*IdleTimer) Dec added in v0.33.12

func (it *IdleTimer) Dec()

func (*IdleTimer) Inc added in v0.33.12

func (it *IdleTimer) Inc()

func (*IdleTimer) Stop added in v0.33.12

func (it *IdleTimer) Stop()

type Node added in v0.33.12

type Node struct {
	Client  *Client
	UUID    string
	Version string
	BaseVer int
	// contains filtered or unexported fields
}

func NewNode added in v0.33.12

func NewNode(uuid, vs string, bv int) *Node

func (*Node) AddNode added in v0.33.12

func (n *Node) AddNode(node *Node)

func (*Node) AddSignal added in v0.33.12

func (n *Node) AddSignal(signal *conn.Conn)

func (*Node) AddTunnel added in v0.33.12

func (n *Node) AddTunnel(tunnel any)

func (*Node) Close added in v0.33.12

func (n *Node) Close() error

func (*Node) GetSignal added in v0.33.12

func (n *Node) GetSignal() *conn.Conn

func (*Node) GetTunnel added in v0.33.12

func (n *Node) GetTunnel() any

func (*Node) IsOffline added in v0.33.12

func (n *Node) IsOffline() bool

func (*Node) IsOnline added in v0.33.12

func (n *Node) IsOnline() bool

func (*Node) IsTunnelClosed added in v0.33.12

func (n *Node) IsTunnelClosed() bool

func (*Node) Retry added in v0.33.12

func (n *Node) Retry() bool

type SelectMode added in v0.33.12

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