tunnel

package
v0.2.24 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: MIT Imports: 56 Imported by: 3

Documentation

Index

Constants

View Source
const (
	MaxWeight uint8 = 0xff
)

Variables

View Source
var (
	ErrBadVersion         = errors.New("bad version")
	ErrUnknownCmd         = errors.New("unknown command")
	ErrTunnelID           = errors.New("invalid tunnel ID")
	ErrTunnelNotAvailable = errors.New("tunnel not available")
	ErrUnauthorized       = errors.New("unauthorized")
	ErrTunnelRoute        = errors.New("no route to host")
	ErrPrivateTunnel      = errors.New("private tunnel")
)

Functions

func NewHandler

func NewHandler(opts ...handler.Option) handler.Handler

Types

type Connector

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

func NewConnector

func NewConnector(id relay.ConnectorID, tid relay.TunnelID, node string, s *mux.Session, opts *ConnectorOptions) *Connector

func (*Connector) Close added in v0.1.6

func (c *Connector) Close() error

func (*Connector) GetConn added in v0.1.9

func (c *Connector) GetConn() (net.Conn, error)

func (*Connector) ID

func (c *Connector) ID() relay.ConnectorID

func (*Connector) IsClosed added in v0.1.9

func (c *Connector) IsClosed() bool

type ConnectorOptions added in v0.1.9

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

type ConnectorPool

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

func NewConnectorPool

func NewConnectorPool(node string) *ConnectorPool

func (*ConnectorPool) Add

func (p *ConnectorPool) Add(tid relay.TunnelID, c *Connector, ttl time.Duration)

func (*ConnectorPool) Close added in v0.1.6

func (p *ConnectorPool) Close() error

func (*ConnectorPool) Get

func (p *ConnectorPool) Get(network string, tid string) *Connector

type Dialer

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

func (*Dialer) Dial

func (d *Dialer) Dial(ctx context.Context, network string, tid string) (conn net.Conn, node string, cid string, err error)

type Tunnel

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

func NewTunnel

func NewTunnel(node string, tid relay.TunnelID, ttl time.Duration) *Tunnel

func (*Tunnel) AddConnector

func (t *Tunnel) AddConnector(c *Connector)

func (*Tunnel) Close added in v0.1.6

func (t *Tunnel) Close() error

func (*Tunnel) CloseOnIdle

func (t *Tunnel) CloseOnIdle() bool

func (*Tunnel) GetConnector

func (t *Tunnel) GetConnector(network string) *Connector

func (*Tunnel) ID

func (t *Tunnel) ID() relay.TunnelID

Jump to

Keyboard shortcuts

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