protocol

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: May 14, 2022 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFailAuth     = fmt.Errorf("fail to authenticate")
	ErrReplayAttack = fmt.Errorf("replay attack")
)
View Source
var Mapper = make(map[string]Creator)

Functions

func NewDialer added in v1.1.3

func NewDialer(name string, nextDialer proxy.Dialer, header Header) (proxy.Dialer, error)

func Register added in v1.1.3

func Register(name string, c Creator)

func TCPAddrToUDPAddr added in v1.1.3

func TCPAddrToUDPAddr(addr *net.TCPAddr) *net.UDPAddr

Types

type Creator added in v1.1.3

type Creator func(nextDialer proxy.Dialer, header Header) (proxy.Dialer, error)
type Header struct {
	ProxyAddress    string
	SNI             string
	GrpcServiceName string
	Cipher          string
	Password        string
	IsClient        bool
}

type Metadata added in v1.1.3

type Metadata struct {
	Type     MetadataType
	Hostname string
	Port     uint16
	// Cmd is valid only if Type is MetadataTypeMsg.
	Cmd      MetadataCmd
	Cipher   string
	IsClient bool
}

func ParseMetadata added in v1.1.6

func ParseMetadata(tgt string) (mdata Metadata, err error)

type MetadataCmd

type MetadataCmd uint8
const (
	MetadataCmdPing MetadataCmd = iota
	MetadataCmdSyncPassages
	MetadataCmdResponse
)

type MetadataType added in v1.1.3

type MetadataType int
const (
	MetadataTypeIPv4 MetadataType = iota
	MetadataTypeIPv6
	MetadataTypeDomain
	MetadataTypeMsg
	MetadataTypeInvalid
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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