tunnel

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 40 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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")
	ErrRateLimit          = errors.New("rate limiting exceeded")
)

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, sd sd.SD) *Connector

func (*Connector) ID

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

func (*Connector) Session

func (c *Connector) Session() *mux.Session

type ConnectorPool

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

func NewConnectorPool

func NewConnectorPool(node string, sd sd.SD) *ConnectorPool

func (*ConnectorPool) Add

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

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) 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

func (*Tunnel) WithSD

func (t *Tunnel) WithSD(sd sd.SD)

Jump to

Keyboard shortcuts

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