shadowsocks

package
v2.5.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2016 License: MIT Imports: 30 Imported by: 0

Documentation

Overview

Package shadowsocks is a generated protocol buffer package.

It is generated from these files:

v2ray.com/core/proxy/shadowsocks/config.proto

It has these top-level messages:

Account
ServerConfig
ClientConfig

R.I.P Shadowsocks

Index

Constants

View Source
const (
	Version                  = 1
	RequestOptionOneTimeAuth = protocol.RequestOption(101)

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

Variables

View Source
var Account_OneTimeAuth_name = map[int32]string{
	0: "Auto",
	1: "Disabled",
	2: "Enabled",
}
View Source
var Account_OneTimeAuth_value = map[string]int32{
	"Auto":     0,
	"Disabled": 1,
	"Enabled":  2,
}
View Source
var CipherType_name = map[int32]string{
	0: "UNKNOWN",
	1: "AES_128_CFB",
	2: "AES_256_CFB",
	3: "CHACHA20",
	4: "CHACHA20_IEFT",
}
View Source
var CipherType_value = map[string]int32{
	"UNKNOWN":       0,
	"AES_128_CFB":   1,
	"AES_256_CFB":   2,
	"CHACHA20":      3,
	"CHACHA20_IEFT": 4,
}

Functions

func ChunkKeyGenerator added in v1.9.1

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

func DecodeUDPPacket

func DecodeUDPPacket(user *protocol.User, payload *alloc.Buffer) (*protocol.RequestHeader, *alloc.Buffer, error)

func EncodeUDPPacket

func EncodeUDPPacket(request *protocol.RequestHeader, payload *alloc.Buffer) (*alloc.Buffer, error)

func HeaderKeyGenerator added in v1.9.1

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

func PasswordToCipherKey added in v1.9.1

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

func ReadTCPResponse

func ReadTCPResponse(user *protocol.User, reader io.Reader) (v2io.Reader, error)

func ReadTCPSession

func ReadTCPSession(user *protocol.User, reader io.Reader) (*protocol.RequestHeader, v2io.Reader, error)

func WriteTCPRequest

func WriteTCPRequest(request *protocol.RequestHeader, writer io.Writer) (v2io.Writer, error)

func WriteTCPResponse

func WriteTCPResponse(request *protocol.RequestHeader, writer io.Writer) (v2io.Writer, error)

Types

type Account

type Account struct {
	Password   string              `protobuf:"bytes,1,opt,name=password" json:"password,omitempty"`
	CipherType CipherType          `` /* 130-byte string literal not displayed */
	Ota        Account_OneTimeAuth `protobuf:"varint,3,opt,name=ota,enum=v2ray.core.proxy.shadowsocks.Account_OneTimeAuth" json:"ota,omitempty"`
}

func (*Account) AsAccount

func (this *Account) AsAccount() (protocol.Account, error)

func (*Account) Descriptor

func (*Account) Descriptor() ([]byte, []int)

func (*Account) GetCipher

func (this *Account) GetCipher() (Cipher, error)

func (*Account) GetCipherKey

func (this *Account) GetCipherKey() []byte

func (*Account) ProtoMessage

func (*Account) ProtoMessage()

func (*Account) Reset

func (m *Account) Reset()

func (*Account) String

func (m *Account) String() string

type Account_OneTimeAuth

type Account_OneTimeAuth int32
const (
	Account_Auto     Account_OneTimeAuth = 0
	Account_Disabled Account_OneTimeAuth = 1
	Account_Enabled  Account_OneTimeAuth = 2
)

func (Account_OneTimeAuth) EnumDescriptor

func (Account_OneTimeAuth) EnumDescriptor() ([]byte, []int)

func (Account_OneTimeAuth) String

func (x Account_OneTimeAuth) String() string

type AesCfb added in v1.9.1

type AesCfb struct {
	KeyBytes int
}

func (*AesCfb) IVSize added in v1.9.1

func (this *AesCfb) IVSize() int

func (*AesCfb) KeySize added in v1.9.1

func (this *AesCfb) KeySize() int

func (*AesCfb) NewDecodingStream added in v1.9.1

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

func (*AesCfb) NewEncodingStream added in v1.9.1

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

type Authenticator added in v1.9.1

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

func NewAuthenticator added in v1.9.1

func NewAuthenticator(keygen KeyGenerator) *Authenticator

func (*Authenticator) Authenticate added in v1.9.1

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

type ChaCha20 added in v1.9.1

type ChaCha20 struct {
	IVBytes int
}

func (*ChaCha20) IVSize added in v1.9.1

func (this *ChaCha20) IVSize() int

func (*ChaCha20) KeySize added in v1.9.1

func (this *ChaCha20) KeySize() int

func (*ChaCha20) NewDecodingStream added in v1.9.1

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

func (*ChaCha20) NewEncodingStream added in v1.9.1

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

type ChunkReader added in v1.9.1

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

func NewChunkReader added in v1.9.1

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

func (*ChunkReader) Read added in v1.9.1

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

func (*ChunkReader) Release added in v1.11.1

func (this *ChunkReader) Release()

type ChunkWriter

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

func NewChunkWriter

func NewChunkWriter(writer io.Writer, auth *Authenticator) *ChunkWriter

func (*ChunkWriter) Release

func (this *ChunkWriter) Release()

func (*ChunkWriter) Write

func (this *ChunkWriter) Write(payload *alloc.Buffer) error

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 CipherType

type CipherType int32
const (
	CipherType_UNKNOWN       CipherType = 0
	CipherType_AES_128_CFB   CipherType = 1
	CipherType_AES_256_CFB   CipherType = 2
	CipherType_CHACHA20      CipherType = 3
	CipherType_CHACHA20_IEFT CipherType = 4
)

func (CipherType) EnumDescriptor

func (CipherType) EnumDescriptor() ([]byte, []int)

func (CipherType) String

func (x CipherType) String() string

type Client

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

func NewClient

func NewClient(config *ClientConfig, space app.Space, meta *proxy.OutboundHandlerMeta) (*Client, error)

func (*Client) Dispatch

func (this *Client) Dispatch(destination v2net.Destination, payload *alloc.Buffer, ray ray.OutboundRay) error

type ClientConfig

type ClientConfig struct {
	Server []*v2ray_core_common_protocol1.ServerEndpoint `protobuf:"bytes,1,rep,name=server" json:"server,omitempty"`
}

func (*ClientConfig) Descriptor

func (*ClientConfig) Descriptor() ([]byte, []int)

func (*ClientConfig) GetServer

func (*ClientConfig) ProtoMessage

func (*ClientConfig) ProtoMessage()

func (*ClientConfig) Reset

func (m *ClientConfig) Reset()

func (*ClientConfig) String

func (m *ClientConfig) String() string

type ClientFactory

type ClientFactory struct{}

func (*ClientFactory) Create

func (this *ClientFactory) Create(space app.Space, rawConfig interface{}, meta *proxy.OutboundHandlerMeta) (proxy.OutboundHandler, error)

func (*ClientFactory) StreamCapability

func (this *ClientFactory) StreamCapability() v2net.NetworkList

type KeyGenerator added in v1.9.1

type KeyGenerator func() []byte

type Server

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

func NewServer

func NewServer(config *ServerConfig, space app.Space, meta *proxy.InboundHandlerMeta) (*Server, error)

func (*Server) Close added in v1.12.9

func (this *Server) Close()

func (*Server) Port added in v1.12.9

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

func (*Server) Start added in v1.17.1

func (this *Server) Start() error

type ServerConfig

type ServerConfig struct {
	UdpEnabled bool                             `protobuf:"varint,1,opt,name=udp_enabled,json=udpEnabled" json:"udp_enabled,omitempty"`
	User       *v2ray_core_common_protocol.User `protobuf:"bytes,2,opt,name=user" json:"user,omitempty"`
}

func (*ServerConfig) Descriptor

func (*ServerConfig) Descriptor() ([]byte, []int)

func (*ServerConfig) GetUser

func (*ServerConfig) ProtoMessage

func (*ServerConfig) ProtoMessage()

func (*ServerConfig) Reset

func (m *ServerConfig) Reset()

func (*ServerConfig) String

func (m *ServerConfig) String() string

type ServerFactory added in v1.17.1

type ServerFactory struct{}

func (*ServerFactory) Create added in v1.17.1

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

func (*ServerFactory) StreamCapability added in v1.17.1

func (this *ServerFactory) StreamCapability() v2net.NetworkList

type ShadowsocksAccount

type ShadowsocksAccount struct {
	Cipher      Cipher
	Key         []byte
	OneTimeAuth Account_OneTimeAuth
}

func (*ShadowsocksAccount) Equals

func (this *ShadowsocksAccount) Equals(another protocol.Account) bool

type UDPReader

type UDPReader struct {
	Reader io.Reader
	User   *protocol.User
}

func (*UDPReader) Read

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

func (*UDPReader) Release

func (this *UDPReader) Release()

type UDPWriter

type UDPWriter struct {
	Writer  io.Writer
	Request *protocol.RequestHeader
}

func (*UDPWriter) Release

func (this *UDPWriter) Release()

func (*UDPWriter) Write

func (this *UDPWriter) Write(buffer *alloc.Buffer) error

Jump to

Keyboard shortcuts

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