shadowsocks

package
v1.24.4 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2016 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

R.I.P Shadowsocks

Index

Constants

View Source
const (
	AddrTypeIPv4   = 1
	AddrTypeIPv6   = 4
	AddrTypeDomain = 3
)
View Source
const (
	AuthSize = 10
)

Variables

This section is empty.

Functions

func ChunkKeyGenerator

func ChunkKeyGenerator(iv []byte) func() []byte

func HeaderKeyGenerator

func HeaderKeyGenerator(key []byte, iv []byte) func() []byte

func PasswordToCipherKey

func PasswordToCipherKey(password string, keySize int) []byte

Types

type AesCfb

type AesCfb struct {
	KeyBytes int
}

func (*AesCfb) IVSize

func (this *AesCfb) IVSize() int

func (*AesCfb) KeySize

func (this *AesCfb) KeySize() int

func (*AesCfb) NewDecodingStream

func (this *AesCfb) NewDecodingStream(key []byte, iv []byte) (cipher.Stream, error)

func (*AesCfb) NewEncodingStream

func (this *AesCfb) NewEncodingStream(key []byte, iv []byte) (cipher.Stream, error)

type Authenticator

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

func NewAuthenticator

func NewAuthenticator(keygen KeyGenerator) *Authenticator

func (*Authenticator) Authenticate

func (this *Authenticator) Authenticate(auth []byte, data []byte) []byte

type ChaCha20

type ChaCha20 struct {
	IVBytes int
}

func (*ChaCha20) IVSize

func (this *ChaCha20) IVSize() int

func (*ChaCha20) KeySize

func (this *ChaCha20) KeySize() int

func (*ChaCha20) NewDecodingStream

func (this *ChaCha20) NewDecodingStream(key []byte, iv []byte) (cipher.Stream, error)

func (*ChaCha20) NewEncodingStream

func (this *ChaCha20) NewEncodingStream(key []byte, iv []byte) (cipher.Stream, error)

type ChunkReader

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

func NewChunkReader

func NewChunkReader(reader io.Reader, auth *Authenticator) *ChunkReader

func (*ChunkReader) Read

func (this *ChunkReader) Read() (*alloc.Buffer, error)

func (*ChunkReader) Release

func (this *ChunkReader) Release()

type Cipher

type Cipher interface {
	KeySize() int
	IVSize() int
	NewEncodingStream(key []byte, iv []byte) (cipher.Stream, error)
	NewDecodingStream(key []byte, iv []byte) (cipher.Stream, error)
}

type Config

type Config struct {
	Cipher Cipher
	Key    []byte
	UDP    bool
	Level  protocol.UserLevel
	Email  string
}

type KeyGenerator

type KeyGenerator func() []byte

type Request

type Request struct {
	Address    v2net.Address
	Port       v2net.Port
	OTA        bool
	UDPPayload *alloc.Buffer
}

func ReadRequest

func ReadRequest(reader io.Reader, auth *Authenticator, udp bool) (*Request, error)

func (*Request) DetachUDPPayload

func (this *Request) DetachUDPPayload() *alloc.Buffer

func (*Request) Release

func (this *Request) Release()

type Server

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

func NewServer

func NewServer(config *Config, packetDispatcher dispatcher.PacketDispatcher, meta *proxy.InboundHandlerMeta) *Server

func (*Server) Close

func (this *Server) Close()

func (*Server) Port

func (this *Server) Port() v2net.Port

func (*Server) Start

func (this *Server) Start() error

type ServerFactory

type ServerFactory struct{}

func (*ServerFactory) Create

func (this *ServerFactory) Create(space app.Space, rawConfig interface{}, meta *proxy.InboundHandlerMeta) (proxy.InboundHandler, error)

func (*ServerFactory) StreamCapability

func (this *ServerFactory) StreamCapability() internet.StreamConnectionType

Jump to

Keyboard shortcuts

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