protocol

package
v0.0.0-...-5f1f6bc Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Flags_Tuic_UdpRelayModeQuic = 1 << iota
)
View Source
const (
	Flags_VMess_UsePacketAddr = 1 << iota
)

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

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

func Register

func Register(name string, c Creator)

func TCPAddrToUDPAddr

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

Types

type Creator

type Creator func(nextDialer netproxy.Dialer, header Header) (netproxy.Dialer, error)

type Flags

type Flags uint64
type Header struct {
	ProxyAddress string
	SNI          string
	Feature1     string
	TlsConfig    *tls.Config
	Cipher       string
	User         string
	Password     string
	IsClient     bool
	Flags        Flags
}

type Metadata

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

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

func (*Metadata) AddrPort

func (m *Metadata) AddrPort() (netip.AddrPort, error)

type MetadataCmd

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

type MetadataType

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

type Protocol

type Protocol string
const (
	ProtocolVMessTCP     Protocol = "vmess"
	ProtocolVMessTlsGrpc Protocol = "vmess+tls+grpc"
	ProtocolShadowsocks  Protocol = "shadowsocks"
)

func (Protocol) Valid

func (p Protocol) Valid() bool

func (Protocol) WithTLS

func (p Protocol) WithTLS() bool

Directories

Path Synopsis
infra

Jump to

Keyboard shortcuts

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