Versions in this module Expand all Collapse all v1 v1.1.30 Apr 17, 2023 Changes in this version + const MaxSize + const MaxThread + var ErrorEmptyChain = errors.New("empty chain") + var ErrorInvalidNode = errors.New("invalid node") + var RouteNAT = NewNAT() + var Server8422 = net.ResolveUDPAddr("udp", "localhost:8422") + func TCPListener(addr string) (net.Listener, error) + type Chain struct + Retries int + func NewChain(retry int, node *Node) *Chain + func (c *Chain) DialContext(ctx context.Context) (conn net.Conn, err error) + func (c *Chain) IsEmpty() bool + func (c *Chain) Node() *Node + type Client struct + type Connector interface + ConnectContext func(ctx context.Context, conn net.Conn) (net.Conn, error) + func UDPOverTCPTunnelConnector() Connector + type DataElem struct + type Device struct + func (d *Device) Close() + func (d *Device) Start() + type Handler interface + Handle func(ctx context.Context, conn net.Conn) + func TCPHandler() Handler + func TunHandler(chain *Chain, node *Node) Handler + type NAT struct + func NewNAT() *NAT + func (n *NAT) LoadOrStore(to net.IP, addr net.Addr) (result net.Addr, load bool) + func (n *NAT) Range(f func(key string, v []net.Addr)) + func (n *NAT) Remove(ip net.IP, addr net.Addr) + func (n *NAT) RemoveAddr(addr net.Addr) (count int) + func (n *NAT) RouteTo(ip net.IP) net.Addr + type Node struct + Addr string + Client *Client + Protocol string + Remote string + Values url.Values + func ParseNode(s string) (*Node, error) + func (node *Node) Get(key string) string + func (node *Node) GetInt(key string) int + type Peer struct + func (p *Peer) Close() + func (p *Peer) Start() + type Route struct + ChainNode string + Retries int + ServeNodes []string + func (r *Route) GenerateServers() ([]Server, error) + type Server struct + Handler Handler + Listener net.Listener + type Transporter interface + Dial func(ctx context.Context, addr string) (net.Conn, error) + func TCPTransporter() Transporter