diff --git a/.travis.yml b/.travis.yml index f07fc39f..503d829f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,6 @@ language: go +go: + - 1.1 install: - go get github.com/cyfdecyf/leakybuf - go get code.google.com/p/go.crypto/blowfish diff --git a/CHANGELOG b/CHANGELOG index 4b6cf940..e9f800cb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,15 @@ -0.6.3 (not released) - * Support IPv6 server +1.1.1 (2013-07-12) + * Add -b option to limit listen address for client + * Fix can't override server address on command line + +1.1 (2013-05-26) + * Add more encryption methods + * Enable CGO for OS X when building + +1.0 (2013-05-17) + * Support specify servers with IPv6 address + * Support IPv6 address in socks requests + * Better handling of configuration file for debian package 0.6.2 (2013-03-15) * Connect to multiple servers in the order specified in config diff --git a/README.md b/README.md index ee24116c..7de90074 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # shadowsocks-go -Current version: 1.1 [![Build Status](https://travis-ci.org/shadowsocks/shadowsocks-go.png?branch=master)](https://travis-ci.org/shadowsocks/shadowsocks-go) +Current version: 1.1.1 [![Build Status](https://travis-ci.org/shadowsocks/shadowsocks-go.png?branch=master)](https://travis-ci.org/shadowsocks/shadowsocks-go) shadowsocks-go is a lightweight tunnel proxy which can help you get through firewalls. It is a port of [shadowsocks](https://github.com/clowwindy/shadowsocks). @@ -35,7 +35,7 @@ Configuration file is in json format and has the same syntax with [shadowsocks-n server your server ip or hostname server_port server port local_port local socks5 proxy port -method encryption method, null by default, or use any of the following: +method encryption method, null by default, the following methods are supported: aes-128-cfb, aes-192-cfb, aes-256-cfb, bf-cfb, cast5-cfb, des-cfb, rc4 password a password used to encrypt transfer timeout server option, in seconds @@ -49,18 +49,27 @@ On client, run `shadowsocks-local`. Change proxy settings of your browser to SOCKS5 127.0.0.1:local_port ``` +## About encryption methods + +AES is recommended for shadowsocks-go. ([Intel AES Instruction Set](http://en.wikipedia.org/wiki/AES_instruction_set) will be used if available and can make encryption/decryption fast.) + +**rc4 and table encryption methods are deprecated because they are not secure**. + ## Command line options Command line options can override settings from configuration files. Use `-h` option to see all available options. ``` -shadowsocks-local -s server_name -p server_port -l local_port -k password -m rc4 -c config.json -shadowsocks-server -p server_port -k password -t timeout -m rc4 -c config.json +shadowsocks-local -s server_address -p server_port -k password + -m rc4 -c config.json + -b local_address -l local_port +shadowsocks-server -p server_port -k password + -m rc4 -c config.json + -t timeout ``` Use `-d` option to enable debug message. - ## Use multiple servers on client ``` diff --git a/cmd/shadowsocks-httpget/httpget.go b/cmd/shadowsocks-httpget/httpget.go index e7aaa152..2e54833d 100644 --- a/cmd/shadowsocks-httpget/httpget.go +++ b/cmd/shadowsocks-httpget/httpget.go @@ -49,7 +49,7 @@ func doOneRequest(client *http.Client, uri string, buf []byte) (err error) { return } -func get(connid int, uri, serverAddr string, rawAddr []byte, cipher ss.Cipher, done chan []time.Duration) { +func get(connid int, uri, serverAddr string, rawAddr []byte, cipher *ss.Cipher, done chan []time.Duration) { reqDone := 0 reqTime := make([]time.Duration, config.nreq) defer func() { @@ -96,6 +96,10 @@ func main() { runtime.GOMAXPROCS(config.core) uri := flag.Arg(0) + if strings.HasPrefix(uri, "https://") { + fmt.Println("https not supported") + os.Exit(1) + } if !strings.HasPrefix(uri, "http://") { uri = "http://" + uri } @@ -122,7 +126,6 @@ func main() { rawAddr, err := ss.RawAddr(host) if err != nil { panic("Error getting raw address.") - return } done := make(chan []time.Duration) diff --git a/cmd/shadowsocks-local/local.go b/cmd/shadowsocks-local/local.go index 7e95dcf0..68ec07dc 100644 --- a/cmd/shadowsocks-local/local.go +++ b/cmd/shadowsocks-local/local.go @@ -320,12 +320,12 @@ func handleConnection(conn net.Conn) { debug.Println("closed connection to", addr) } -func run(port string) { - ln, err := net.Listen("tcp", ":"+port) +func run(listenAddr string) { + ln, err := net.Listen("tcp", listenAddr) if err != nil { log.Fatal(err) } - log.Printf("starting local socks5 server at port %v ...\n", port) + log.Printf("starting local socks5 server at %v ...\n", listenAddr) for { conn, err := ln.Accept() if err != nil { @@ -344,13 +344,14 @@ func enoughOptions(config *ss.Config) bool { func main() { log.SetOutput(os.Stdout) - var configFile, cmdServer string + var configFile, cmdServer, cmdLocal string var cmdConfig ss.Config var printVer bool flag.BoolVar(&printVer, "version", false, "print version") flag.StringVar(&configFile, "c", "config.json", "specify config file") flag.StringVar(&cmdServer, "s", "", "server address") + flag.StringVar(&cmdLocal, "b", "", "local address, listen only to this address if specified") flag.StringVar(&cmdConfig.Password, "k", "", "password") flag.IntVar(&cmdConfig.ServerPort, "p", 0, "server port") flag.IntVar(&cmdConfig.LocalPort, "l", 0, "local socks5 proxy port") @@ -405,5 +406,5 @@ func main() { parseServerConfig(config) - run(strconv.Itoa(config.LocalPort)) + run(cmdLocal + ":" + strconv.Itoa(config.LocalPort)) } diff --git a/sample-config/server-multi-port.json b/sample-config/server-multi-port.json index be8db6c4..1ef4f645 100644 --- a/sample-config/server-multi-port.json +++ b/sample-config/server-multi-port.json @@ -3,6 +3,5 @@ "8387": "foobar", "8388": "barfoo" }, - "timeout": 60, - "cache_enctable": true + "timeout": 600, } diff --git a/script/build.sh b/script/build.sh index 30305d79..75d00ec8 100755 --- a/script/build.sh +++ b/script/build.sh @@ -52,8 +52,8 @@ build windows 386 win32 local build linux amd64 linux64 server build linux 386 linux32 server #build darwin amd64 mac64 server -#build windows amd64 win64 server -#build windows 386 win32 server +build windows amd64 win64 server +build windows 386 win32 server script/createdeb.sh amd64 script/createdeb.sh 386 diff --git a/script/test.sh b/script/test.sh index 41a9fdfc..0286a0a0 100755 --- a/script/test.sh +++ b/script/test.sh @@ -68,6 +68,14 @@ test_server_local_pair() { echo "============================================================" echo "server: $SERVER, local: $LOCAL" echo "============================================================" + + local url + if [[ -z "$TRAVIS" ]]; then + url="www.baidu.com" + else + # on travis + url="www.google.com" + fi test_shadowsocks baidu.com table test_shadowsocks baidu.com rc4 test_shadowsocks baidu.com aes-128-cfb diff --git a/shadowsocks/encrypt.go b/shadowsocks/encrypt.go index 4294e38a..c189d77f 100644 --- a/shadowsocks/encrypt.go +++ b/shadowsocks/encrypt.go @@ -224,6 +224,4 @@ func (c *Cipher) Copy() *Cipher { nc.dec = nil return &nc } - // should not reach here, keep it to make go 1.0.x compiler happy - return nil } diff --git a/shadowsocks/util.go b/shadowsocks/util.go index a81d8fe7..801b966a 100644 --- a/shadowsocks/util.go +++ b/shadowsocks/util.go @@ -7,7 +7,7 @@ import ( ) func PrintVersion() { - const version = "1.1" + const version = "1.1.1" fmt.Println("shadowsocks-go version", version) }