Documentation ¶
Index ¶
- Constants
- Variables
- func Kdf(key, iv []byte, buffer *buf.Buffer)
- type BufferedWriter
- type Method
- type MultiService
- func (s *MultiService[U]) Name() string
- func (s *MultiService[U]) NewConnection(ctx context.Context, conn net.Conn, metadata M.Metadata) error
- func (s *MultiService[U]) NewError(ctx context.Context, err error)
- func (s *MultiService[U]) NewPacket(ctx context.Context, conn N.PacketConn, buffer *buf.Buffer, ...) error
- func (s *MultiService[U]) UpdateUsers(userList []U, keyList [][]byte) error
- func (s *MultiService[U]) UpdateUsersWithPasswords(userList []U, passwordList []string) error
- func (s *MultiService[U]) WriteIsThreadUnsafe()
- type Reader
- func (r *Reader) Buffer() *buf.Buffer
- func (r *Reader) Cached() int
- func (r *Reader) CachedSlice() []byte
- func (r *Reader) Discard(n int) error
- func (r *Reader) Read(b []byte) (n int, err error)
- func (r *Reader) ReadByte() (byte, error)
- func (r *Reader) ReadChunk(buffer *buf.Buffer, chunk []byte) error
- func (r *Reader) ReadExternalChunk(chunk []byte) error
- func (r *Reader) ReadWithLength(length uint16) error
- func (r *Reader) ReadWithLengthChunk(lengthChunk []byte) error
- func (r *Reader) Upstream() any
- func (r *Reader) WriteTo(writer io.Writer) (n int64, err error)
- type Service
- func (s *Service) Name() string
- func (s *Service) NewConnection(ctx context.Context, conn net.Conn, metadata M.Metadata) error
- func (s *Service) NewError(ctx context.Context, err error)
- func (s *Service) NewPacket(ctx context.Context, conn N.PacketConn, buffer *buf.Buffer, ...) error
- func (s *Service) Password() string
- func (c *Service) WriteIsThreadUnsafe()
- type Writer
- func (w *Writer) Buffer() *buf.Buffer
- func (w *Writer) BufferedWriter(reversed int) *BufferedWriter
- func (w *Writer) ReadFrom(r io.Reader) (n int64, err error)
- func (w *Writer) Upstream() any
- func (w *Writer) Write(p []byte) (n int, err error)
- func (w *Writer) WriteChunk(buffer *buf.Buffer, chunk []byte)
- func (w *Writer) WriteVectorised(buffers []*buf.Buffer) error
Constants ¶
View Source
const ( MaxPacketSize = 16*1024 - 1 PacketLengthBufferSize = 2 )
https://shadowsocks.org/en/wiki/AEAD-Ciphers.html
View Source
const ( // Overhead // crypto/cipher.gcmTagSize // golang.org/x/crypto/chacha20poly1305.Overhead Overhead = 16 )
Variables ¶
View Source
var ErrBadHeader = E.New("bad header")
View Source
var List = []string{
"aes-128-gcm",
"aes-192-gcm",
"aes-256-gcm",
"chacha20-ietf-poly1305",
"xchacha20-ietf-poly1305",
}
Functions ¶
Types ¶
type BufferedWriter ¶
type BufferedWriter struct {
// contains filtered or unexported fields
}
func (*BufferedWriter) Flush ¶
func (w *BufferedWriter) Flush() error
type Method ¶
type Method struct {
// contains filtered or unexported fields
}
func (*Method) DialEarlyConn ¶
func (*Method) DialPacketConn ¶
func (m *Method) DialPacketConn(conn net.Conn) N.NetPacketConn
type MultiService ¶ added in v0.2.1
type MultiService[U comparable] struct { // contains filtered or unexported fields }
func NewMultiService ¶ added in v0.2.1
func NewMultiService[U comparable](method string, udpTimeout int64, handler shadowsocks.Handler) (*MultiService[U], error)
func (*MultiService[U]) Name ¶ added in v0.2.1
func (s *MultiService[U]) Name() string
func (*MultiService[U]) NewConnection ¶ added in v0.2.1
func (*MultiService[U]) NewError ¶ added in v0.2.1
func (s *MultiService[U]) NewError(ctx context.Context, err error)
func (*MultiService[U]) NewPacket ¶ added in v0.2.1
func (s *MultiService[U]) NewPacket(ctx context.Context, conn N.PacketConn, buffer *buf.Buffer, metadata M.Metadata) error
func (*MultiService[U]) UpdateUsers ¶ added in v0.2.1
func (s *MultiService[U]) UpdateUsers(userList []U, keyList [][]byte) error
func (*MultiService[U]) UpdateUsersWithPasswords ¶ added in v0.2.1
func (s *MultiService[U]) UpdateUsersWithPasswords(userList []U, passwordList []string) error
func (*MultiService[U]) WriteIsThreadUnsafe ¶ added in v0.2.1
func (s *MultiService[U]) WriteIsThreadUnsafe()
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func NewRawReader ¶
func (*Reader) CachedSlice ¶
func (*Reader) ReadExternalChunk ¶
func (*Reader) ReadWithLength ¶
func (*Reader) ReadWithLengthChunk ¶
type Service ¶
type Service struct { *Method // contains filtered or unexported fields }
func NewService ¶
func (*Service) NewConnection ¶
func (*Service) WriteIsThreadUnsafe ¶
func (c *Service) WriteIsThreadUnsafe()
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
func NewRawWriter ¶
func (*Writer) BufferedWriter ¶
func (w *Writer) BufferedWriter(reversed int) *BufferedWriter
Click to show internal directories.
Click to hide internal directories.