shadowsocks

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Decrypt = 0
	Encrypt = 1
)

Variables

This section is empty.

Functions

func ClientHandshake

func ClientHandshake(conn net.Conn, hostPort string) error

func ClientHandshakeTimeout

func ClientHandshakeTimeout(conn net.Conn, hostPort string, timeout time.Duration) error

func EvpBytesToKey

func EvpBytesToKey(password string, keyLen int) []byte

func RegisterCipher

func RegisterCipher(name string, c cipherInfo)

func ServerHandshake

func ServerHandshake(conn net.Conn) (hostPort string, err error)

func ServerHandshakeTimeout

func ServerHandshakeTimeout(conn net.Conn, timeout time.Duration) (hostPort string, err error)

Types

type Conn

type Conn struct {
	net.Conn
	// contains filtered or unexported fields
}

func Dial

func Dial(network, address, hostPort, method, password string) (*Conn, error)

func DialTimeout

func DialTimeout(network, address, hostPort, method, password string, timeout time.Duration) (*Conn, error)

func (*Conn) Read

func (c *Conn) Read(p []byte) (int, error)

func (*Conn) Write

func (c *Conn) Write(p []byte) (int, error)

type Cryptor

type Cryptor interface {
	DecFrom(r io.Reader, p []byte) (int, error)
	EncTo(w io.Writer, p []byte) (int, error)
	KeySize() int
	IvSize() int
}

func NewCipher

func NewCipher(method, password string) (Cryptor, error)

type Listener

type Listener struct {
	net.Listener
	// contains filtered or unexported fields
}

func Listen

func Listen(network, address, method, password string) (*Listener, error)

func ListenTimeout

func ListenTimeout(network, address, method, password string, timeout time.Duration) (*Listener, error)

func (*Listener) Accept

func (l *Listener) Accept() (conn net.Conn, hostPort string, err error)

Jump to

Keyboard shortcuts

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