Skip to content

Commit

Permalink
Merge branch 'develop', version 1.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
cyfdecyf committed Sep 28, 2014
2 parents 733f2a3 + 144fa0f commit bd08cc4
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 22 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
1.1.3 (2014-09-28)
* Fix can't specify encryption method in config file

1.1.2 (2014-09-21)
* Support new encryption method "rc4-md5"
* Use aes-256-cfb as default encryption method for command line app
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# shadowsocks-go

Current version: 1.1.2 [![Build Status](https://travis-ci.org/shadowsocks/shadowsocks-go.png?branch=master)](https://travis-ci.org/shadowsocks/shadowsocks-go)
Current version: 1.1.3 [![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).

Expand Down
6 changes: 4 additions & 2 deletions cmd/shadowsocks-local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ func main() {
flag.StringVar(&cmdConfig.Password, "k", "", "password")
flag.IntVar(&cmdConfig.ServerPort, "p", 0, "server port")
flag.IntVar(&cmdConfig.LocalPort, "l", 0, "local socks5 proxy port")
flag.StringVar(&cmdConfig.Method, "m", "aes-256-cfb", "encryption method")
flag.StringVar(&cmdConfig.Method, "m", "", "encryption method, default: aes-256-cfb")
flag.BoolVar((*bool)(&debug), "d", false, "print debug message")

flag.Parse()
Expand Down Expand Up @@ -388,7 +388,9 @@ func main() {
} else {
ss.UpdateConfig(config, &cmdConfig)
}

if config.Method == "" {
config.Method = "aes-256-cfb"
}
if len(config.ServerPassword) == 0 {
if !enoughOptions(config) {
fmt.Fprintln(os.Stderr, "must specify server address, password and both server/local port")
Expand Down
5 changes: 4 additions & 1 deletion cmd/shadowsocks-server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ func main() {
flag.StringVar(&cmdConfig.Password, "k", "", "password")
flag.IntVar(&cmdConfig.ServerPort, "p", 0, "server port")
flag.IntVar(&cmdConfig.Timeout, "t", 60, "connection timeout (in seconds)")
flag.StringVar(&cmdConfig.Method, "m", "aes-256-cfb", "encryption method")
flag.StringVar(&cmdConfig.Method, "m", "", "encryption method, default: aes-256-cfb")
flag.IntVar(&core, "core", 0, "maximum number of CPU cores to use, default is determinied by Go runtime")
flag.BoolVar((*bool)(&debug), "d", false, "print debug message")

Expand All @@ -346,6 +346,9 @@ func main() {
} else {
ss.UpdateConfig(config, &cmdConfig)
}
if config.Method == "" {
config.Method = "aes-256-cfb"
}
if err = ss.CheckCipherMethod(config.Method); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
Expand Down
37 changes: 20 additions & 17 deletions script/test.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
#!/bin/bash

# Use [ -n "$TRAVIS" ] to test for running on Travis-CI.

# Run in the scripts directory.
cd "$( dirname "${BASH_SOURCE[0]}" )"

OPTION="-p 8389 -k foobar"
LOCAL_PORT="1090"
SERVER_PORT="8389"
OPTION="-p $SERVER_PORT -k foobar"
SOCKS="127.0.0.1:$LOCAL_PORT"
HTTP_PORT="8123"

wait_server() {
local port
port=$1
for i in {1..20}; do
# sleep first because this maybe called immediately after server start
sleep 0.1
nc -z -w 4 127.0.0.1 $port && break
done
}

start_http_server() {
go build http.go
./http $HTTP_PORT &
wait_server $HTTP_PORT
http_pid=$!
}

Expand All @@ -20,6 +34,8 @@ stop_http_server() {

test_get() {
local url
local target
local code
url=$1
target=$2
code=$3
Expand Down Expand Up @@ -56,24 +72,11 @@ test_shadowsocks() {

$SERVER $OPTION -m "$method" &
server_pid=$!
wait_server $SERVER_PORT

$LOCAL $OPTION -s 127.0.0.1 -l $LOCAL_PORT -m "$method" &
local_pid=$!

# Wait server and client finish startup.
sleeptime=0.1
if [ -n "$TRAVIS" ]; then
# On Travis we need to wait a little longer.
sleeptime=1
elif echo $SERVER $LOCAL | grep 'py'; then
# The python version is slow to start.
if [[ $method == "table" ]]; then
sleeptime=2
else
sleeptime=0.5
fi
fi
echo $sleeptime
sleep $sleeptime
wait_server $LOCAL_PORT

for i in {1..3}; do
if ! test_get $url "shadowsocks-go"; then
Expand Down
2 changes: 1 addition & 1 deletion shadowsocks/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

func PrintVersion() {
const version = "1.1.2"
const version = "1.1.3"
fmt.Println("shadowsocks-go version", version)
}

Expand Down

0 comments on commit bd08cc4

Please sign in to comment.