From f5097a56c7327f583e20ec70aad19ffed25899df Mon Sep 17 00:00:00 2001 From: Chen Yufei Date: Thu, 13 Jun 2013 22:28:01 +0800 Subject: [PATCH 1/7] Specify go 1.1 in Travis, remove unnecessary return. --- .travis.yml | 2 ++ cmd/shadowsocks-httpget/httpget.go | 7 +++++-- shadowsocks/encrypt.go | 2 -- 3 files changed, 7 insertions(+), 4 deletions(-) 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/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/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 } From f2832134f676e6a291987c47f398707f1954bf53 Mon Sep 17 00:00:00 2001 From: Chen Yufei Date: Wed, 10 Jul 2013 11:40:04 +0800 Subject: [PATCH 2/7] Delete removed option in multi port config sample. --- sample-config/server-multi-port.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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, } From 1caf18e7d047b3623d482969cbf76c5fbf068e8b Mon Sep 17 00:00:00 2001 From: Chen Yufei Date: Wed, 10 Jul 2013 13:02:10 +0800 Subject: [PATCH 3/7] Use google as test target on travis. --- script/test.sh | 8 ++++++++ 1 file changed, 8 insertions(+) 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 From 192392dfef620dc1bd6da53525476a809ce55e51 Mon Sep 17 00:00:00 2001 From: Chen Yufei Date: Fri, 12 Jul 2013 18:30:48 +0800 Subject: [PATCH 4/7] Add -b option to listen to specific address for client. --- cmd/shadowsocks-local/local.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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)) } From 6838b09adccbacbcfc2d3dfaded915a604f41877 Mon Sep 17 00:00:00 2001 From: Chen Yufei Date: Fri, 12 Jul 2013 18:54:01 +0800 Subject: [PATCH 5/7] Update README. Recommend AES encryption method. Document the -b option for the client. --- README.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index bc9f0f06..de70b7cc 100644 --- a/README.md +++ b/README.md @@ -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 ``` From e58f77e4eb2b1bab5d7937181ff1e78133d24388 Mon Sep 17 00:00:00 2001 From: Chen Yufei Date: Fri, 12 Jul 2013 18:55:20 +0800 Subject: [PATCH 6/7] Build windows server in build script. --- script/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 From 9607c6bc4ca6549971d3fba6037f60dc23fa4a25 Mon Sep 17 00:00:00 2001 From: Chen Yufei Date: Fri, 12 Jul 2013 19:16:24 +0800 Subject: [PATCH 7/7] Bump version to 1.1.1 --- CHANGELOG | 14 ++++++++++++-- README.md | 2 +- shadowsocks/util.go | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) 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 de70b7cc..20a0f81f 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=develop)](https://travis-ci.org/shadowsocks/shadowsocks-go) +Current version: 1.1.1 [![Build Status](https://travis-ci.org/shadowsocks/shadowsocks-go.png?branch=develop)](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). 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) }