Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeTestPayload ¶ added in v1.0.3
Types ¶
type CipherEntry ¶ added in v1.0.3
type CipherEntry struct {
ID string
Cipher shadowaead.Cipher
}
CipherEntry holds a Cipher with an identifier.
type CipherList ¶ added in v1.0.3
type CipherList interface {
PushBack(id string, cipher shadowaead.Cipher) *list.Element
SafeSnapshot() []*list.Element
SafeMoveToFront(e *list.Element)
}
CipherList is a list of CipherEntry elements that allows for thread-safe snapshotting and moving to front.
func MakeTestCiphers ¶ added in v1.0.3
func MakeTestCiphers(numCiphers int) (CipherList, error)
func NewCipherList ¶ added in v1.0.3
func NewCipherList() CipherList
NewCipherList creates an empty CipherList
type ShadowsocksReader ¶
ShadowsocksReader is an io.Reader that also implements io.WriterTo to allow for piping the data without extra allocations and copies.
func NewShadowsocksReader ¶
func NewShadowsocksReader(reader io.Reader, ssCipher shadowaead.Cipher) ShadowsocksReader
NewShadowsocksReader creates a Reader that decrypts the given Reader using the shadowsocks protocol with the given shadowsocks cipher.
type ShadowsocksWriter ¶
type ShadowsocksWriter interface {
io.Writer
io.ReaderFrom
}
ShadowsocksWriter is an io.Writer that also implements io.ReaderFrom to allow for piping the data without extra allocations and copies.
func NewShadowsocksWriter ¶
func NewShadowsocksWriter(writer io.Writer, ssCipher shadowaead.Cipher) ShadowsocksWriter
NewShadowsocksWriter creates a Writer that encrypts the given Writer using the shadowsocks protocol with the given shadowsocks cipher.
type TCPService ¶
type TCPService interface {
Start()
Stop() error
}
TCPService is a Shadowsocks TCP service that can be started and stopped.
func NewTCPService ¶
func NewTCPService(listener *net.TCPListener, ciphers *CipherList, m metrics.ShadowsocksMetrics) TCPService
NewTCPService creates a TCPService
type UDPService ¶
type UDPService interface {
Start()
Stop() error
}
UDPService is a UDP shadowsocks service that can be started and stopped.
func NewUDPService ¶
func NewUDPService(clientConn net.PacketConn, natTimeout time.Duration, cipherList *CipherList, m metrics.ShadowsocksMetrics) UDPService
NewUDPService creates a UDPService