Skip to content
This repository was archived by the owner on Apr 9, 2020. It is now read-only.

Commit bd08cc4

Browse files
committedSep 28, 2014
Merge branch 'develop', version 1.1.3
2 parents 733f2a3 + 144fa0f commit bd08cc4

File tree

6 files changed

+33
-22
lines changed

6 files changed

+33
-22
lines changed
 

‎CHANGELOG

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
1.1.3 (2014-09-28)
2+
* Fix can't specify encryption method in config file
3+
14
1.1.2 (2014-09-21)
25
* Support new encryption method "rc4-md5"
36
* Use aes-256-cfb as default encryption method for command line app

‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# shadowsocks-go
22

3-
Current version: 1.1.2 [![Build Status](https://travis-ci.org/shadowsocks/shadowsocks-go.png?branch=master)](https://travis-ci.org/shadowsocks/shadowsocks-go)
3+
Current version: 1.1.3 [![Build Status](https://travis-ci.org/shadowsocks/shadowsocks-go.png?branch=master)](https://travis-ci.org/shadowsocks/shadowsocks-go)
44

55
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).
66

‎cmd/shadowsocks-local/local.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ func main() {
355355
flag.StringVar(&cmdConfig.Password, "k", "", "password")
356356
flag.IntVar(&cmdConfig.ServerPort, "p", 0, "server port")
357357
flag.IntVar(&cmdConfig.LocalPort, "l", 0, "local socks5 proxy port")
358-
flag.StringVar(&cmdConfig.Method, "m", "aes-256-cfb", "encryption method")
358+
flag.StringVar(&cmdConfig.Method, "m", "", "encryption method, default: aes-256-cfb")
359359
flag.BoolVar((*bool)(&debug), "d", false, "print debug message")
360360

361361
flag.Parse()
@@ -388,7 +388,9 @@ func main() {
388388
} else {
389389
ss.UpdateConfig(config, &cmdConfig)
390390
}
391-
391+
if config.Method == "" {
392+
config.Method = "aes-256-cfb"
393+
}
392394
if len(config.ServerPassword) == 0 {
393395
if !enoughOptions(config) {
394396
fmt.Fprintln(os.Stderr, "must specify server address, password and both server/local port")

‎cmd/shadowsocks-server/server.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ func main() {
322322
flag.StringVar(&cmdConfig.Password, "k", "", "password")
323323
flag.IntVar(&cmdConfig.ServerPort, "p", 0, "server port")
324324
flag.IntVar(&cmdConfig.Timeout, "t", 60, "connection timeout (in seconds)")
325-
flag.StringVar(&cmdConfig.Method, "m", "aes-256-cfb", "encryption method")
325+
flag.StringVar(&cmdConfig.Method, "m", "", "encryption method, default: aes-256-cfb")
326326
flag.IntVar(&core, "core", 0, "maximum number of CPU cores to use, default is determinied by Go runtime")
327327
flag.BoolVar((*bool)(&debug), "d", false, "print debug message")
328328

@@ -346,6 +346,9 @@ func main() {
346346
} else {
347347
ss.UpdateConfig(config, &cmdConfig)
348348
}
349+
if config.Method == "" {
350+
config.Method = "aes-256-cfb"
351+
}
349352
if err = ss.CheckCipherMethod(config.Method); err != nil {
350353
fmt.Fprintln(os.Stderr, err)
351354
os.Exit(1)

‎script/test.sh

+20-17
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,30 @@
11
#!/bin/bash
22

3+
# Use [ -n "$TRAVIS" ] to test for running on Travis-CI.
4+
35
# Run in the scripts directory.
46
cd "$( dirname "${BASH_SOURCE[0]}" )"
57

6-
OPTION="-p 8389 -k foobar"
78
LOCAL_PORT="1090"
9+
SERVER_PORT="8389"
10+
OPTION="-p $SERVER_PORT -k foobar"
811
SOCKS="127.0.0.1:$LOCAL_PORT"
912
HTTP_PORT="8123"
1013

14+
wait_server() {
15+
local port
16+
port=$1
17+
for i in {1..20}; do
18+
# sleep first because this maybe called immediately after server start
19+
sleep 0.1
20+
nc -z -w 4 127.0.0.1 $port && break
21+
done
22+
}
23+
1124
start_http_server() {
1225
go build http.go
1326
./http $HTTP_PORT &
27+
wait_server $HTTP_PORT
1428
http_pid=$!
1529
}
1630

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

2135
test_get() {
2236
local url
37+
local target
38+
local code
2339
url=$1
2440
target=$2
2541
code=$3
@@ -56,24 +72,11 @@ test_shadowsocks() {
5672

5773
$SERVER $OPTION -m "$method" &
5874
server_pid=$!
75+
wait_server $SERVER_PORT
76+
5977
$LOCAL $OPTION -s 127.0.0.1 -l $LOCAL_PORT -m "$method" &
6078
local_pid=$!
61-
62-
# Wait server and client finish startup.
63-
sleeptime=0.1
64-
if [ -n "$TRAVIS" ]; then
65-
# On Travis we need to wait a little longer.
66-
sleeptime=1
67-
elif echo $SERVER $LOCAL | grep 'py'; then
68-
# The python version is slow to start.
69-
if [[ $method == "table" ]]; then
70-
sleeptime=2
71-
else
72-
sleeptime=0.5
73-
fi
74-
fi
75-
echo $sleeptime
76-
sleep $sleeptime
79+
wait_server $LOCAL_PORT
7780

7881
for i in {1..3}; do
7982
if ! test_get $url "shadowsocks-go"; then

‎shadowsocks/util.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
)
88

99
func PrintVersion() {
10-
const version = "1.1.2"
10+
const version = "1.1.3"
1111
fmt.Println("shadowsocks-go version", version)
1212
}
1313

0 commit comments

Comments
 (0)