tunnel

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2023 License: GPL-3.0 Imports: 8 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	DomainName  string
	Port        int
	NetworkType string
	net.IP
	AddressType
}

func NewAddressFromAddr

func NewAddressFromAddr(network string, addr string) (*Address, error)

func NewAddressFromHostPort

func NewAddressFromHostPort(network string, host string, port int) *Address

func (*Address) Network

func (a *Address) Network() string

func (*Address) ReadFrom

func (a *Address) ReadFrom(r io.Reader) error

func (*Address) ResolveIP

func (a *Address) ResolveIP() (net.IP, error)

func (*Address) String

func (a *Address) String() string

func (*Address) WriteTo

func (a *Address) WriteTo(w io.Writer) error

type AddressType

type AddressType byte
const (
	IPv4       AddressType = 1
	DomainName AddressType = 3
	IPv6       AddressType = 4
)

type Client

type Client interface {
	Dialer
	io.Closer
}

type Command

type Command byte

type Conn

type Conn interface {
	net.Conn
	Metadata() *Metadata
}

type ConnDialer

type ConnDialer interface {
	DialConn(*Address, Tunnel) (net.Conn, error)
}

type ConnListener

type ConnListener interface {
	AcceptConn(Tunnel) (Conn, error)
}

type Dialer

type Dialer interface {
	ConnDialer
}

type Metadata

type Metadata struct {
	Command
	*Address
}

type PacketConn

type PacketConn interface {
	net.PacketConn
	WriteWithMetadata([]byte, *Metadata) (int, error)
	ReadWithMetadata([]byte) (int, *Metadata, error)
}

type PacketDialer

type PacketDialer interface {
	DialPacket(Tunnel) (PacketConn, error)
}

type PacketListener

type PacketListener interface {
	AcceptPacket(Tunnel) (PacketConn, error)
}

type Server

type Server interface {
	ConnListener
	PacketListener
	io.Closer
}

type Tunnel

type Tunnel interface {
	Name() string
	// NewClient(context.Context, Client) (Client, error)
	NewServer(context.Context, Server) (Server, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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