protocol

package
v0.3.1-beta Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcAdler32

func CalcAdler32(input []byte) uint32

func CheckAdler32

func CheckAdler32(input []byte, l int) bool

func Kdf

func Kdf(password string, keyLen int) []byte

key-derivation function from original Shadowsocks

Types

type AuthData

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

type IProtocol

type IProtocol interface {
	PreEncrypt(data []byte) ([]byte, error)
	PostDecrypt(data []byte) ([]byte, int, error)
	PreEncryptPacket(data []byte) ([]byte, error)
	PostDecryptPacket(data []byte) ([]byte, error)
	GetOverhead() int
	AddOverhead(size int)

	GetData() interface{}
	SetData(interface{})
}

func NewAuthAES128MD5

func NewAuthAES128MD5(info ssr.ServerInfo) IProtocol

func NewAuthAES128SHA1

func NewAuthAES128SHA1(info ssr.ServerInfo) IProtocol

func NewAuthChainA

func NewAuthChainA(info ssr.ServerInfo) IProtocol

func NewAuthChainB

func NewAuthChainB(info ssr.ServerInfo) IProtocol

func NewAuthSHA1v4

func NewAuthSHA1v4(info ssr.ServerInfo) IProtocol

func NewOrigin

func NewOrigin(ssr.ServerInfo) IProtocol

func NewVerifySHA1

func NewVerifySHA1(info ssr.ServerInfo) IProtocol

type Protocol

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

func NewProtocol

func NewProtocol(name string, info ssr.ServerInfo, overhead int) (*Protocol, error)

func (*Protocol) PacketProtocol

func (p *Protocol) PacketProtocol(conn net.PacketConn) *protocolPacket

func (*Protocol) StreamProtocol

func (p *Protocol) StreamProtocol(conn net.Conn, writeIV []byte) net.Conn

Jump to

Keyboard shortcuts

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