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

Commit c33324b

Browse files
committedJul 12, 2013
Merge branch 'develop', version 1.1.1
2 parents 78809dd + 9607c6b commit c33324b

File tree

10 files changed

+51
-21
lines changed

10 files changed

+51
-21
lines changed
 

‎.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
language: go
2+
go:
3+
- 1.1
24
install:
35
- go get github.com/cyfdecyf/leakybuf
46
- go get code.google.com/p/go.crypto/blowfish

‎CHANGELOG

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1-
0.6.3 (not released)
2-
* Support IPv6 server
1+
1.1.1 (2013-07-12)
2+
* Add -b option to limit listen address for client
3+
* Fix can't override server address on command line
4+
5+
1.1 (2013-05-26)
6+
* Add more encryption methods
7+
* Enable CGO for OS X when building
8+
9+
1.0 (2013-05-17)
10+
* Support specify servers with IPv6 address
11+
* Support IPv6 address in socks requests
12+
* Better handling of configuration file for debian package
313

414
0.6.2 (2013-03-15)
515
* Connect to multiple servers in the order specified in config

‎README.md

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

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

@@ -35,7 +35,7 @@ Configuration file is in json format and has the same syntax with [shadowsocks-n
3535
server your server ip or hostname
3636
server_port server port
3737
local_port local socks5 proxy port
38-
method encryption method, null by default, or use any of the following:
38+
method encryption method, null by default, the following methods are supported:
3939
aes-128-cfb, aes-192-cfb, aes-256-cfb, bf-cfb, cast5-cfb, des-cfb, rc4
4040
password a password used to encrypt transfer
4141
timeout server option, in seconds
@@ -49,18 +49,27 @@ On client, run `shadowsocks-local`. Change proxy settings of your browser to
4949
SOCKS5 127.0.0.1:local_port
5050
```
5151

52+
## About encryption methods
53+
54+
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.)
55+
56+
**rc4 and table encryption methods are deprecated because they are not secure**.
57+
5258
## Command line options
5359

5460
Command line options can override settings from configuration files. Use `-h` option to see all available options.
5561

5662
```
57-
shadowsocks-local -s server_name -p server_port -l local_port -k password -m rc4 -c config.json
58-
shadowsocks-server -p server_port -k password -t timeout -m rc4 -c config.json
63+
shadowsocks-local -s server_address -p server_port -k password
64+
-m rc4 -c config.json
65+
-b local_address -l local_port
66+
shadowsocks-server -p server_port -k password
67+
-m rc4 -c config.json
68+
-t timeout
5969
```
6070

6171
Use `-d` option to enable debug message.
6272

63-
6473
## Use multiple servers on client
6574

6675
```

‎cmd/shadowsocks-httpget/httpget.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func doOneRequest(client *http.Client, uri string, buf []byte) (err error) {
4949
return
5050
}
5151

52-
func get(connid int, uri, serverAddr string, rawAddr []byte, cipher ss.Cipher, done chan []time.Duration) {
52+
func get(connid int, uri, serverAddr string, rawAddr []byte, cipher *ss.Cipher, done chan []time.Duration) {
5353
reqDone := 0
5454
reqTime := make([]time.Duration, config.nreq)
5555
defer func() {
@@ -96,6 +96,10 @@ func main() {
9696

9797
runtime.GOMAXPROCS(config.core)
9898
uri := flag.Arg(0)
99+
if strings.HasPrefix(uri, "https://") {
100+
fmt.Println("https not supported")
101+
os.Exit(1)
102+
}
99103
if !strings.HasPrefix(uri, "http://") {
100104
uri = "http://" + uri
101105
}
@@ -122,7 +126,6 @@ func main() {
122126
rawAddr, err := ss.RawAddr(host)
123127
if err != nil {
124128
panic("Error getting raw address.")
125-
return
126129
}
127130

128131
done := make(chan []time.Duration)

‎cmd/shadowsocks-local/local.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -320,12 +320,12 @@ func handleConnection(conn net.Conn) {
320320
debug.Println("closed connection to", addr)
321321
}
322322

323-
func run(port string) {
324-
ln, err := net.Listen("tcp", ":"+port)
323+
func run(listenAddr string) {
324+
ln, err := net.Listen("tcp", listenAddr)
325325
if err != nil {
326326
log.Fatal(err)
327327
}
328-
log.Printf("starting local socks5 server at port %v ...\n", port)
328+
log.Printf("starting local socks5 server at %v ...\n", listenAddr)
329329
for {
330330
conn, err := ln.Accept()
331331
if err != nil {
@@ -344,13 +344,14 @@ func enoughOptions(config *ss.Config) bool {
344344
func main() {
345345
log.SetOutput(os.Stdout)
346346

347-
var configFile, cmdServer string
347+
var configFile, cmdServer, cmdLocal string
348348
var cmdConfig ss.Config
349349
var printVer bool
350350

351351
flag.BoolVar(&printVer, "version", false, "print version")
352352
flag.StringVar(&configFile, "c", "config.json", "specify config file")
353353
flag.StringVar(&cmdServer, "s", "", "server address")
354+
flag.StringVar(&cmdLocal, "b", "", "local address, listen only to this address if specified")
354355
flag.StringVar(&cmdConfig.Password, "k", "", "password")
355356
flag.IntVar(&cmdConfig.ServerPort, "p", 0, "server port")
356357
flag.IntVar(&cmdConfig.LocalPort, "l", 0, "local socks5 proxy port")
@@ -405,5 +406,5 @@ func main() {
405406

406407
parseServerConfig(config)
407408

408-
run(strconv.Itoa(config.LocalPort))
409+
run(cmdLocal + ":" + strconv.Itoa(config.LocalPort))
409410
}

‎sample-config/server-multi-port.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
"8387": "foobar",
44
"8388": "barfoo"
55
},
6-
"timeout": 60,
7-
"cache_enctable": true
6+
"timeout": 600,
87
}

‎script/build.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ build windows 386 win32 local
5252
build linux amd64 linux64 server
5353
build linux 386 linux32 server
5454
#build darwin amd64 mac64 server
55-
#build windows amd64 win64 server
56-
#build windows 386 win32 server
55+
build windows amd64 win64 server
56+
build windows 386 win32 server
5757

5858
script/createdeb.sh amd64
5959
script/createdeb.sh 386

‎script/test.sh

+8
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ test_server_local_pair() {
6868
echo "============================================================"
6969
echo "server: $SERVER, local: $LOCAL"
7070
echo "============================================================"
71+
72+
local url
73+
if [[ -z "$TRAVIS" ]]; then
74+
url="www.baidu.com"
75+
else
76+
# on travis
77+
url="www.google.com"
78+
fi
7179
test_shadowsocks baidu.com table
7280
test_shadowsocks baidu.com rc4
7381
test_shadowsocks baidu.com aes-128-cfb

‎shadowsocks/encrypt.go

-2
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,4 @@ func (c *Cipher) Copy() *Cipher {
224224
nc.dec = nil
225225
return &nc
226226
}
227-
// should not reach here, keep it to make go 1.0.x compiler happy
228-
return nil
229227
}

‎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"
10+
const version = "1.1.1"
1111
fmt.Println("shadowsocks-go version", version)
1212
}
1313

0 commit comments

Comments
 (0)
This repository has been archived.