shadowsocks

package module
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2017 License: MIT Imports: 18 Imported by: 0

README

shadowsocks

minimalist port of shadowsocks, only reserve basic feature for personal usage.

Installation

server
go get github.com/cssivision/shadowsocks/cmd/ssserver

prebuild releases.

client
go get github.com/cssivision/shadowsocks/cmd/sslocal

Configuration

config.json

{
	"server_addr": ":8089",
	"password": "password",
	"local_addr": ":6009",
	"method": "aes-128-cfb",
	"timeout": 300
}

Usage

server
ssserver -c config.json

install a client, connect to your server using your configuration, Done!

Licenses

All source code is licensed under the MIT License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyBuffer

func CopyBuffer(dst io.Writer, src io.Reader) (written int64, err error)

func Socks5Negotiate

func Socks5Negotiate(conn net.Conn) ([]byte, string, error)

func WriteRandomData added in v0.1.4

func WriteRandomData(r io.Writer) error

WriteRandomData ...

Types

type Cipher

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

Cipher struct

func NewCipher

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

NewCipher ...

func (*Cipher) Clone

func (c *Cipher) Clone() *Cipher

Clone cipher clone

func (*Cipher) Decrypt

func (c *Cipher) Decrypt(dst, src []byte)

Decrypt decrypt data

func (*Cipher) Encrypt

func (c *Cipher) Encrypt(dst, src []byte)

Encrypt encrypt data

type CipherInfo

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

type Config

type Config struct {
	// local addr, default is ":6009"
	LocalAddr string `json:"local_addr"`
	// server addr, default is ":7008"
	ServerAddr string `json:"server_addr"`
	// password, default is "shadowsocks-secret-key"
	Password string `json:"password"`
	// cipher method, default is "ase-128-cfb"
	Method string `json:"method"`
	// connection timeout, default is 300
	Timeout int `json:"timeout"`
}

func ParseConfig

func ParseConfig(configPath string) (*Config, error)

type Conn

type Conn struct {
	net.Conn
	*Cipher
}

Conn conn with cipher

func DialWithCipher

func DialWithCipher(address string, cipher *Cipher) (*Conn, error)

func NewConn

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

NewConn ...

func (*Conn) Read

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

func (*Conn) Write

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

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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