dokodemo

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const MaxPacketSize = 1024 * 8
View Source
const Name = "DOKODEMO"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	LocalHost  string `json:"local_addr" yaml:"local-addr"`
	LocalPort  int    `json:"local_port" yaml:"local-port"`
	TargetHost string `json:"target_addr" yaml:"target-addr"`
	TargetPort int    `json:"target_port" yaml:"target-port"`
	UDPTimeout int    `json:"udp_timeout" yaml:"udp-timeout"`
}

type Conn

type Conn struct {
	net.Conn
	// contains filtered or unexported fields
}

func (*Conn) Epoch

func (c *Conn) Epoch() time.Time

func (*Conn) Metadata

func (c *Conn) Metadata() *tunnel.Metadata

func (*Conn) Name

func (c *Conn) Name() string

func (*Conn) Recv

func (c *Conn) Recv() uint64

func (*Conn) Sent

func (c *Conn) Sent() uint64

func (*Conn) Tunnels

func (c *Conn) Tunnels() *tunnel.Tunnels

func (*Conn) User

func (c *Conn) User() statistic.User

type PacketConn

type PacketConn struct {
	net.PacketConn
	// contains filtered or unexported fields
}

PacketConn receive packet info from the packet dispatcher

func (*PacketConn) Close

func (c *PacketConn) Close() error

func (*PacketConn) Epoch

func (c *PacketConn) Epoch() time.Time

func (*PacketConn) Name

func (c *PacketConn) Name() string

func (*PacketConn) ReadFrom

func (c *PacketConn) ReadFrom(p []byte) (int, net.Addr, error)

func (*PacketConn) ReadWithMetadata

func (c *PacketConn) ReadWithMetadata(p []byte) (int, *tunnel.Metadata, error)

func (*PacketConn) Recv

func (c *PacketConn) Recv() uint64

func (*PacketConn) Sent

func (c *PacketConn) Sent() uint64

func (*PacketConn) Tunnels

func (c *PacketConn) Tunnels() *tunnel.Tunnels

func (*PacketConn) User

func (c *PacketConn) User() statistic.User

func (*PacketConn) WriteTo

func (c *PacketConn) WriteTo(p []byte, addr net.Addr) (int, error)

func (*PacketConn) WriteWithMetadata

func (c *PacketConn) WriteWithMetadata(p []byte, m *tunnel.Metadata) (int, error)

type Server

type Server struct {
	tunnel.Server
	// contains filtered or unexported fields
}

func NewServer

func NewServer(ctx context.Context, _ tunnel.Server) (*Server, error)

func (*Server) AcceptConn

func (s *Server) AcceptConn(tunnel.Tunnel) (tunnel.Conn, error)

func (*Server) AcceptPacket

func (s *Server) AcceptPacket(tunnel.Tunnel) (tunnel.PacketConn, error)

func (*Server) Close

func (s *Server) Close() error

type Tunnel

type Tunnel struct{ tunnel.Tunnel }

func (*Tunnel) Name

func (*Tunnel) Name() string

func (*Tunnel) NewClient

func (*Tunnel) NewClient(ctx context.Context, underlay tunnel.Client) (tunnel.Client, error)

func (*Tunnel) NewServer

func (*Tunnel) NewServer(ctx context.Context, underlay tunnel.Server) (tunnel.Server, error)

Jump to

Keyboard shortcuts

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