proto

package
v0.0.0-...-e5d0cd3 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const ObfsHMACSHA1Len = 10

Variables

View Source
var (
	ErrAuthSHA1v4CRC32Error                = errors.New("auth_sha1_v4 post decrypt data crc32 error")
	ErrAuthSHA1v4DataLengthError           = errors.New("auth_sha1_v4 post decrypt data length error")
	ErrAuthSHA1v4IncorrectChecksum         = errors.New("auth_sha1_v4 post decrypt incorrect checksum")
	ErrAuthAES128IncorrectHMAC             = errors.New("auth_aes128_* post decrypt incorrect hmac")
	ErrAuthAES128DataLengthError           = errors.New("auth_aes128_* post decrypt length mismatch")
	ErrAuthChainDataLengthError            = errors.New("auth_chain_* post decrypt length mismatch")
	ErrAuthChainIncorrectHMAC              = errors.New("auth_chain_* post decrypt incorrect hmac")
	ErrAuthAES128IncorrectChecksum         = errors.New("auth_aes128_* post decrypt incorrect checksum")
	ErrAuthAES128PosOutOfRange             = errors.New("auth_aes128_* post decrypt pos out of range")
	ErrTLS12TicketAuthTooShortData         = errors.New("tls1.2_ticket_auth too short data")
	ErrTLS12TicketAuthHMACError            = errors.New("tls1.2_ticket_auth hmac verifying failed")
	ErrTLS12TicketAuthIncorrectMagicNumber = errors.New("tls1.2_ticket_auth incorrect magic number")
)

Functions

This section is empty.

Types

type AuthData

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

type Conn

type Conn struct {
	netproxy.Conn
	Protocol IProtocol
	// contains filtered or unexported fields
}

func NewConn

func NewConn(c netproxy.Conn, proto IProtocol) (*Conn, error)

func (*Conn) Read

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

func (*Conn) Write

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

type Dialer

type Dialer struct {
	NextDialer    netproxy.Dialer
	Protocol      string
	ProtocolParam string
	ObfsOverhead  int
	// contains filtered or unexported fields
}

func (*Dialer) Dial

func (d *Dialer) Dial(network, address string) (netproxy.Conn, error)

type IProtocol

type IProtocol interface {
	InitWithServerInfo(s *ServerInfo)
	Encode(data []byte) ([]byte, error)
	Decode(data []byte) ([]byte, int, error)
	EncodePkt(buf *bytes.Buffer) error
	DecodePkt(data []byte) (pool.Bytes, error)
	SetData(data interface{})
	GetData() interface{}
	GetOverhead() int
}

func NewAuthAES128MD5

func NewAuthAES128MD5() IProtocol

func NewAuthAES128SHA1

func NewAuthAES128SHA1() IProtocol

func NewAuthChainA

func NewAuthChainA() IProtocol

func NewAuthChainB

func NewAuthChainB() IProtocol

func NewAuthSHA1v4

func NewAuthSHA1v4() IProtocol

func NewOrigin

func NewOrigin() IProtocol

func NewProtocol

func NewProtocol(name string) IProtocol

type PacketConn

type PacketConn struct {
	netproxy.PacketConn
	Protocol IProtocol
	// contains filtered or unexported fields
}

func NewPacketConn

func NewPacketConn(c netproxy.PacketConn, proto IProtocol, tgt string) (*PacketConn, error)

func (*PacketConn) InnerCipher

func (c *PacketConn) InnerCipher() *ciphers.StreamCipher

func (*PacketConn) Read

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

func (*PacketConn) ReadFrom

func (c *PacketConn) ReadFrom(b []byte) (n int, from netip.AddrPort, err error)

func (*PacketConn) Write

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

func (*PacketConn) WriteTo

func (c *PacketConn) WriteTo(b []byte, to string) (n int, err error)

type ServerInfo

type ServerInfo struct {
	Param string

	TcpMss   int
	IV       []byte
	Key      []byte
	AddrLen  int
	Overhead int
}

Jump to

Keyboard shortcuts

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