xnet

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IPV4 byte = 1

	DOMAIN byte = 3

	IPV6 byte = 4
)

Variables

View Source
var BreakError = &breakError{}
View Source
var Err_NoCertFile = errors.New("no cert or key file")
View Source
var Err_NoUsefulPoint = errors.New("no useful point")
View Source
var Err_NotBinaryMessage = errors.New("not binary message")
View Source
var Err_NotImplement = errors.New("not implement")
View Source
var TimeoutError = &timeoutError{}

Functions

func Dial

func Dial(addr Addr) (conn net.Conn, err error)

func DialUDP

func DialUDP(addr Addr) (conn net.Conn, err error)

func NewString

func NewString() string

func Read added in v0.9.3

func Read(r io.Reader, b []byte) (n int, err error)

func ReadFull added in v0.9.3

func ReadFull(r io.Reader, b []byte) (n int, err error)

func ReadFullWithTimeout added in v0.9.3

func ReadFullWithTimeout(r io.Reader, b []byte, timeout int64) (n int, err error)

func ReadWithTimeout added in v0.9.3

func ReadWithTimeout(r io.Reader, b []byte, timeout int64) (n int, err error)

Types

type Addr

type Addr []byte

*

+----+-----+-------+------+----+
| ATYP | DST.ADDR | DST.PORT |
+----+-----+-------+------+----+
|  1   | Variable |     2    |
+----+-----+-------+------+----+

func DomainToAddr

func DomainToAddr(host string, port int) Addr

func ReadAddr

func ReadAddr(r io.Reader) (Addr, error)

func (Addr) HostAndPort

func (a Addr) HostAndPort() (host string, port int)

func (Addr) IP

func (a Addr) IP() net.IP

func (Addr) String

func (a Addr) String() string

func (Addr) Type

func (a Addr) Type() byte

type ByteReader added in v0.9.3

type ByteReader struct {
	Break bool
}

func NewByteReader added in v0.9.3

func NewByteReader() *ByteReader

func (*ByteReader) Read added in v0.9.3

func (br *ByteReader) Read(r io.Reader, b []byte) (n int, err error)

func (*ByteReader) ReadFull added in v0.9.3

func (br *ByteReader) ReadFull(r io.Reader, b []byte) (n int, err error)

func (*ByteReader) ReadFullWithTimeout added in v0.9.3

func (br *ByteReader) ReadFullWithTimeout(r io.Reader, b []byte, timeout int64) (n int, err error)

func (*ByteReader) ReadWithTimeout added in v0.9.3

func (br *ByteReader) ReadWithTimeout(r io.Reader, b []byte, timeout int64) (n int, err error)

type Doh

type Doh struct {
	Disabled bool
	Name     string
	Path     string
	Method   string //get or post
}

type IDCode

type IDCode interface {
	ID() string
	Code() string
}

type Point

type Point struct {
	Id           string
	Name         string
	Protocol     string //vless,socks,ss
	Transport    string //http,h2,h3,ws
	Host         string
	Path         string
	Clients      []string
	CertFile     string
	KeyFile      string
	Sni          string
	InsecureSkip bool
	Disabled     bool
	SupportRelay bool
	Latency      int
	Breaking     bool
	BreakTime    int64
}

func (*Point) Code

func (p *Point) Code() string

func (*Point) ID

func (p *Point) ID() string

func (Point) String

func (p Point) String() string

type Rule

type Rule struct {
	Name string

	Type string

	FileName string

	Url string

	Disabled bool

	LastTime int64
}

func (Rule) String

func (r Rule) String() string

type UUID

type UUID uuid.UUID

func NewUUID

func NewUUID() UUID

func (UUID) Code

func (i UUID) Code() string

func (UUID) ID

func (i UUID) ID() string

Directories

Path Synopsis
h1
h2
h3
tcp
udp
ws

Jump to

Keyboard shortcuts

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