mdp

package module
v0.0.0-...-c5ee2b7 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 1989 License: GPL-3.0 Imports: 12 Imported by: 0

README

Multiplex Datagram Protocol Go Reference

Multiplexing TCP, UDP and ICMDP to the MDP.

Credit

poohvpn/icmdp

China Dictatorship 中国独裁统治

License

GNU GPLv3

Copyright 2021 PoohVPN

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Addr

type Addr struct {
	IP   net.IP
	Port int
	Zone string
	// contains filtered or unexported fields
}

func (*Addr) Network

func (a *Addr) Network() string

func (*Addr) String

func (a *Addr) String() string

type Client

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

func NewClient

func NewClient(config Config) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) LocalAddr

func (c *Client) LocalAddr() net.Addr

func (*Client) Read

func (c *Client) Read(b []byte) (n int, err error)

func (*Client) RemoteAddr

func (c *Client) RemoteAddr() net.Addr

func (*Client) SetDeadline

func (c *Client) SetDeadline(t time.Time) error

func (*Client) SetReadDeadline

func (c *Client) SetReadDeadline(t time.Time) error

func (*Client) SetWriteDeadline

func (c *Client) SetWriteDeadline(t time.Time) error

func (*Client) Write

func (c *Client) Write(b []byte) (n int, err error)

type Config

type Config struct {
	SessionID      uint32
	NodeID         uint32
	ForwardNodeIDs []uint32
	DualStackAddr  DualStackAddr
	Threads        int
	DisableICMDP   bool
	DisableTCP     bool
	DisableUDP     bool
	Obfuscator     Obfuscator
}

type DualStackAddr

type DualStackAddr struct {
	IP4  net.IP
	IP6  net.IP
	Port int
	Zone string
}

type Obfuscator

type Obfuscator interface {
	ObfuscatePacketConn(conn net.PacketConn) net.PacketConn
	ObfuscateStreamConn(conn net.Conn) net.Conn
	ObfuscateDatagramConn(conn net.Conn) net.Conn
}

type Server

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

func Listen

func Listen(port int) (s *Server, err error)

func (*Server) Close

func (s *Server) Close() error

func (*Server) DeleteForwardNode

func (s *Server) DeleteForwardNode(id uint32) *Server

func (*Server) LocalAddr

func (s *Server) LocalAddr() net.Addr

func (*Server) ReadFrom

func (s *Server) ReadFrom(p []byte) (n int, addr net.Addr, err error)

func (*Server) SetDeadline

func (s *Server) SetDeadline(t time.Time) error

func (*Server) SetForwardNode

func (s *Server) SetForwardNode(id uint32, addr DualStackAddr) *Server

func (*Server) SetNodeID

func (s *Server) SetNodeID(id uint32) *Server

func (*Server) SetObfuscator

func (s *Server) SetObfuscator(ob Obfuscator) *Server

func (*Server) SetReadDeadline

func (s *Server) SetReadDeadline(t time.Time) error

func (*Server) SetWriteDeadline

func (s *Server) SetWriteDeadline(t time.Time) error

func (*Server) WriteTo

func (s *Server) WriteTo(p []byte, addr net.Addr) (n int, err error)

Directories

Path Synopsis
example

Jump to

Keyboard shortcuts

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