Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrShortPacket = errors.New("short packet")
ErrShortPacket means the packet is too short to be a valid encrypted packet.
Functions ¶
Types ¶
type Cipher ¶
type Cipher interface { IVSize() int Encrypter(iv []byte) cipher.Stream Decrypter(iv []byte) cipher.Stream }
Cipher generates a pair of stream ciphers for encryption and decryption.
func Chacha20IETF ¶
type Conn ¶
A Conn represents a Shadowsocks connection. It implements the net.Conn interface.
func (*Conn) ObtainReadIV ¶
func (*Conn) ObtainWriteIV ¶
type KeySizeError ¶
type KeySizeError int
func (KeySizeError) Error ¶
func (e KeySizeError) Error() string
type PacketConn ¶
type PacketConn struct { N.EnhancePacketConn Cipher }
func NewPacketConn ¶
func NewPacketConn(c N.EnhancePacketConn, ciph Cipher) *PacketConn
NewPacketConn wraps an N.EnhancePacketConn with stream cipher encryption/decryption.
func (*PacketConn) WaitReadFrom ¶
func (c *PacketConn) WaitReadFrom() (data []byte, put func(), addr net.Addr, err error)
Click to show internal directories.
Click to hide internal directories.