Versions in this module Expand all Collapse all v1 v1.4.1 Dec 24, 2021 Changes in this version + var ErrRepeatedSalt = errors.New("repeated salt detected") + var ErrShortPacket = errors.New("short packet") + func NewConn(c net.Conn, ciph Cipher) net.Conn + func NewPacketConn(c net.PacketConn, ciph Cipher) net.PacketConn + func NewReader(r io.Reader, aead cipher.AEAD) io.Reader + func NewWriter(w io.Writer, aead cipher.AEAD) io.Writer + func Pack(dst, plaintext []byte, ciph Cipher) ([]byte, error) + func Unpack(dst, pkt []byte, ciph Cipher) ([]byte, error) + type Cipher interface + Decrypter func(salt []byte) (cipher.AEAD, error) + Encrypter func(salt []byte) (cipher.AEAD, error) + KeySize func() int + SaltSize func() int + func AESGCM(psk []byte) (Cipher, error) + func Chacha20Poly1305(psk []byte) (Cipher, error) + type KeySizeError int + func (e KeySizeError) Error() string + type ShadowsocksStream struct + func (s *ShadowsocksStream) Read(p []byte) (n int, err error) + type StreamConn struct + LastAhead cipher.AEAD + func NewStreamConn(c net.Conn, cipher Cipher) *StreamConn + func (c *StreamConn) ParseSSHeader(data []byte) (raw []byte, host string, isUdp bool, err error) + func (c *StreamConn) Read(b []byte) (int, error) + func (c *StreamConn) ReadFrom(r io.Reader) (int64, error) + func (c *StreamConn) Write(b []byte) (int, error) + func (c *StreamConn) WriteTo(w io.Writer) (int64, error)