Documentation
¶
Index ¶
- Variables
- func CalcAdler32(input []byte) uint32
- func CheckAdler32(input []byte, l int) bool
- func GetHeadSize(data []byte, defaultValue int) int
- type AuthData
- type Protocol
- func NewAuthAES128MD5(info ProtocolInfo) Protocol
- func NewAuthAES128SHA1(info ProtocolInfo) Protocol
- func NewAuthChainA(info ProtocolInfo) Protocol
- func NewAuthChainB(info ProtocolInfo) Protocol
- func NewAuthSHA1v4(info ProtocolInfo) Protocol
- func NewErrorProtocol(err error) Protocol
- func NewOrigin(ProtocolInfo) Protocol
- func NewVerifySHA1(info ProtocolInfo) Protocol
- type ProtocolInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ProtocolMap = map[string]func(ProtocolInfo) Protocol{ "auth_aes128_sha1": NewAuthAES128SHA1, "auth_aes128_md5": NewAuthAES128MD5, "auth_chain_a": NewAuthChainA, "auth_chain_b": NewAuthChainB, "origin": NewOrigin, "auth_sha1_v4": NewAuthSHA1v4, "verify_sha1": NewVerifySHA1, "ota": NewVerifySHA1, }
Functions ¶
func CalcAdler32 ¶
func CheckAdler32 ¶
func GetHeadSize ¶
Types ¶
type Protocol ¶
type Protocol interface { EncryptStream(dst *bytes.Buffer, data []byte) error DecryptStream(dst *bytes.Buffer, data []byte) (int, error) EncryptPacket(data []byte) ([]byte, error) DecryptPacket(data []byte) ([]byte, error) GetOverhead() int }
func NewAuthAES128MD5 ¶
func NewAuthAES128MD5(info ProtocolInfo) Protocol
func NewAuthAES128SHA1 ¶
func NewAuthAES128SHA1(info ProtocolInfo) Protocol
func NewAuthChainA ¶
func NewAuthChainA(info ProtocolInfo) Protocol
func NewAuthChainB ¶
func NewAuthChainB(info ProtocolInfo) Protocol
func NewAuthSHA1v4 ¶
func NewAuthSHA1v4(info ProtocolInfo) Protocol
func NewErrorProtocol ¶
func NewOrigin ¶
func NewOrigin(ProtocolInfo) Protocol
func NewVerifySHA1 ¶
func NewVerifySHA1(info ProtocolInfo) Protocol
type ProtocolInfo ¶
type ProtocolInfo struct { ssr.Info Name string HeadSize int TcpMss int Param string IV []byte Auth *AuthData ObfsOverhead int }
func (ProtocolInfo) Packet ¶
func (s ProtocolInfo) Packet(c net.PacketConn) (net.PacketConn, error)
func (*ProtocolInfo) SetHeadLen ¶
func (s *ProtocolInfo) SetHeadLen(data []byte, defaultValue int)
Click to show internal directories.
Click to hide internal directories.