shadowsocks

package
v0.0.0-...-197c7df Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2016 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OneTimeAuthMask byte = 0x10
	AddrMask        byte = 0xf
)

Variables

This section is empty.

Functions

func ListenPort

func ListenPort(port, method, password string, timeout time.Duration) error

func PipeConnection

func PipeConnection(src, dst net.Conn, timeout time.Duration)

Types

type Cipher

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

func NewCipher

func NewCipher(method, password string) (*Cipher, error)

type Config

type Config struct {
	Server     interface{} `json:"server"`
	ServerPort int         `json:"server_port"`
	LocalPort  int         `json:"local_port"`
	Password   string      `json:"password"`
	Method     string      `json:"method"`
	Auth       bool        `json:"auth"`

	PortPassword map[string]string `json:"port_password"`
	Timeout      int               `json:"timeout"`

	ServerPassword [][]string `json:"server_password"`
}

type Conn

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

func NewConn

func NewConn(c net.Conn, cipher *Cipher) *Conn

func (*Conn) Read

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

func (*Conn) Write

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

type DecOrEnc

type DecOrEnc int
const (
	Decrypt DecOrEnc = iota
	Encrypt
)

Jump to

Keyboard shortcuts

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