From 3b6692b3ef6e138e7e5f328b7ec93a52b8a6ec34 Mon Sep 17 00:00:00 2001 From: Chen Yufei Date: Fri, 15 Mar 2013 14:48:10 +0800 Subject: [PATCH 1/4] Remove duplicate config sample in testdata. --- config.json | 2 +- shadowsocks/config_test.go | 4 ++-- shadowsocks/testdata/client-multi-server.json | 7 ------- shadowsocks/testdata/server-multi-port.json | 8 -------- 4 files changed, 3 insertions(+), 18 deletions(-) delete mode 100644 shadowsocks/testdata/client-multi-server.json delete mode 100644 shadowsocks/testdata/server-multi-port.json diff --git a/config.json b/config.json index de8eb02..0a9f319 100644 --- a/config.json +++ b/config.json @@ -3,5 +3,5 @@ "server_port":8388, "local_port":1080, "password":"barfoo!", - "timeout":0 + "timeout":600 } diff --git a/shadowsocks/config_test.go b/shadowsocks/config_test.go index b13a120..4476b88 100644 --- a/shadowsocks/config_test.go +++ b/shadowsocks/config_test.go @@ -23,7 +23,7 @@ func TestConfigJson(t *testing.T) { } func TestServerMultiPort(t *testing.T) { - config, err := ParseConfig("testdata/server-multi-port.json") + config, err := ParseConfig("../sample-config/server-multi-port.json") if err != nil { t.Fatal("error parsing multi server-multi-port.json:", err) } @@ -59,7 +59,7 @@ func TestDeprecatedClientMultiServerArray(t *testing.T) { } func TestClientMultiServerArray(t *testing.T) { - config, err := ParseConfig("testdata/client-multi-server.json") + config, err := ParseConfig("../sample-config/client-multi-server.json") if err != nil { t.Fatal("error parsing client-multi-server.json:", err) } diff --git a/shadowsocks/testdata/client-multi-server.json b/shadowsocks/testdata/client-multi-server.json deleted file mode 100644 index 0a16c62..0000000 --- a/shadowsocks/testdata/client-multi-server.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "local_port":1081, - "server_password": { - "127.0.0.1:8387": "foobar", - "127.0.0.1:8388": "barfoo" - } -} diff --git a/shadowsocks/testdata/server-multi-port.json b/shadowsocks/testdata/server-multi-port.json deleted file mode 100644 index be8db6c..0000000 --- a/shadowsocks/testdata/server-multi-port.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "port_password": { - "8387": "foobar", - "8388": "barfoo" - }, - "timeout": 60, - "cache_enctable": true -} From bed1f457ffe0b35d0f4a6f49c5c894bd1860f5a7 Mon Sep 17 00:00:00 2001 From: Chen Yufei Date: Fri, 15 Mar 2013 14:53:38 +0800 Subject: [PATCH 2/4] Remove SetDefaultCipher, NewCipher accept cipher parameter. --- cmd/shadowsocks-local/local.go | 8 ++------ cmd/shadowsocks-server/server.go | 6 +----- shadowsocks/encrypt.go | 20 +++++++------------- shadowsocks/encrypt_test.go | 17 +++++------------ 4 files changed, 15 insertions(+), 36 deletions(-) diff --git a/cmd/shadowsocks-local/local.go b/cmd/shadowsocks-local/local.go index 1603096..747af38 100644 --- a/cmd/shadowsocks-local/local.go +++ b/cmd/shadowsocks-local/local.go @@ -152,7 +152,7 @@ var servers struct { func initServers(config *ss.Config) { if len(config.ServerPassword) == 0 { // only one encryption table - cipher, err := ss.NewCipher(config.Password) + cipher, err := ss.NewCipher(config.Method, config.Password) if err != nil { log.Fatal("Failed generating ciphers:", err) } @@ -182,7 +182,7 @@ func initServers(config *ss.Config) { cipher, ok := cipherCache[passwd] if !ok { var err error - cipher, err = ss.NewCipher(passwd) + cipher, err = ss.NewCipher(config.Method, passwd) if err != nil { log.Fatal("Failed generating ciphers:", err) } @@ -338,10 +338,6 @@ func main() { } else { ss.UpdateConfig(config, &cmdConfig) } - if err = ss.SetDefaultCipher(config.Method); err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } if len(config.ServerPassword) == 0 { if !enoughOptions(config) { diff --git a/cmd/shadowsocks-server/server.go b/cmd/shadowsocks-server/server.go index 0f0d868..294d526 100644 --- a/cmd/shadowsocks-server/server.go +++ b/cmd/shadowsocks-server/server.go @@ -266,7 +266,7 @@ func run(port, password string) { // Creating cipher upon first connection. if cipher == nil { log.Println("creating cipher for port:", port) - cipher, err = ss.NewCipher(password) + cipher, err = ss.NewCipher(config.Method, password) if err != nil { log.Printf("Error generating cipher for port: %s password: %s\n", port, password) return @@ -338,10 +338,6 @@ func main() { if err = unifyPortPassword(config); err != nil { os.Exit(1) } - if err = ss.SetDefaultCipher(config.Method); err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } if core > 0 { runtime.GOMAXPROCS(core) } diff --git a/shadowsocks/encrypt.go b/shadowsocks/encrypt.go index 960436d..2471196 100644 --- a/shadowsocks/encrypt.go +++ b/shadowsocks/encrypt.go @@ -28,7 +28,7 @@ type TableCipher struct { } // Creates a new table based cipher. err is always nil. -func NewTableCipher(key string) (c Cipher, err error) { +func NewTableCipher(key string) (c *TableCipher, err error) { if key == "" { return nil, errEmptyKey } @@ -87,7 +87,7 @@ type RC4Cipher struct { enc *rc4.Cipher } -func NewRC4Cipher(key string) (c Cipher, err error) { +func NewRC4Cipher(key string) (c *RC4Cipher, err error) { if key == "" { return nil, errEmptyKey } @@ -117,19 +117,13 @@ func (c RC4Cipher) Copy() Cipher { return &RC4Cipher{&dec, &enc} } -// Function to get default cipher -var NewCipher = NewTableCipher - -// Set default cipher. Empty string of cipher name uses the simple table -// cipher. -func SetDefaultCipher(cipherName string) (err error) { +// Create cipher based on name +func NewCipher(cipherName, key string) (Cipher, error) { switch cipherName { case "": - NewCipher = NewTableCipher + return NewTableCipher(key) case "rc4": - NewCipher = NewRC4Cipher - default: - return errors.New("encryption method " + cipherName + " not supported") + return NewRC4Cipher(key) } - return + return nil, errors.New("encryption method " + cipherName + " not supported") } diff --git a/shadowsocks/encrypt_test.go b/shadowsocks/encrypt_test.go index 256e0cc..484b247 100644 --- a/shadowsocks/encrypt_test.go +++ b/shadowsocks/encrypt_test.go @@ -19,8 +19,7 @@ func checkTable(t *testing.T, tbl *TableCipher, encTarget, decTarget []byte, msg func TestEncrypTable1(t *testing.T) { enc := []byte{60, 53, 84, 138, 217, 94, 88, 23, 39, 242, 219, 35, 12, 157, 165, 181, 255, 143, 83, 247, 162, 16, 31, 209, 190, 171, 115, 65, 38, 41, 21, 245, 236, 46, 121, 62, 166, 233, 44, 154, 153, 145, 230, 49, 128, 216, 173, 29, 241, 119, 64, 229, 194, 103, 131, 110, 26, 197, 218, 59, 204, 56, 27, 34, 141, 221, 149, 239, 192, 195, 24, 155, 170, 183, 11, 254, 213, 37, 137, 226, 75, 203, 55, 19, 72, 248, 22, 129, 33, 175, 178, 10, 198, 71, 77, 36, 113, 167, 48, 2, 117, 140, 142, 66, 199, 232, 243, 32, 123, 54, 51, 82, 57, 177, 87, 251, 150, 196, 133, 5, 253, 130, 8, 184, 14, 152, 231, 3, 186, 159, 76, 89, 228, 205, 156, 96, 163, 146, 18, 91, 132, 85, 80, 109, 172, 176, 105, 13, 50, 235, 127, 0, 189, 95, 98, 136, 250, 200, 108, 179, 211, 214, 106, 168, 78, 79, 74, 210, 30, 73, 201, 151, 208, 114, 101, 174, 92, 52, 120, 240, 15, 169, 220, 182, 81, 224, 43, 185, 40, 99, 180, 17, 212, 158, 42, 90, 9, 191, 45, 6, 25, 4, 222, 67, 126, 1, 116, 124, 206, 69, 61, 7, 68, 97, 202, 63, 244, 20, 28, 58, 93, 134, 104, 144, 227, 147, 102, 118, 135, 148, 47, 238, 86, 112, 122, 70, 107, 215, 100, 139, 223, 225, 164, 237, 111, 125, 207, 160, 187, 246, 234, 161, 188, 193, 249, 252} dec := []byte{151, 205, 99, 127, 201, 119, 199, 211, 122, 196, 91, 74, 12, 147, 124, 180, 21, 191, 138, 83, 217, 30, 86, 7, 70, 200, 56, 62, 218, 47, 168, 22, 107, 88, 63, 11, 95, 77, 28, 8, 188, 29, 194, 186, 38, 198, 33, 230, 98, 43, 148, 110, 177, 1, 109, 82, 61, 112, 219, 59, 0, 210, 35, 215, 50, 27, 103, 203, 212, 209, 235, 93, 84, 169, 166, 80, 130, 94, 164, 165, 142, 184, 111, 18, 2, 141, 232, 114, 6, 131, 195, 139, 176, 220, 5, 153, 135, 213, 154, 189, 238, 174, 226, 53, 222, 146, 162, 236, 158, 143, 55, 244, 233, 96, 173, 26, 206, 100, 227, 49, 178, 34, 234, 108, 207, 245, 204, 150, 44, 87, 121, 54, 140, 118, 221, 228, 155, 78, 3, 239, 101, 64, 102, 17, 223, 41, 137, 225, 229, 66, 116, 171, 125, 40, 39, 71, 134, 13, 193, 129, 247, 251, 20, 136, 242, 14, 36, 97, 163, 181, 72, 25, 144, 46, 175, 89, 145, 113, 90, 159, 190, 15, 183, 73, 123, 187, 128, 248, 252, 152, 24, 197, 68, 253, 52, 69, 117, 57, 92, 104, 157, 170, 214, 81, 60, 133, 208, 246, 172, 23, 167, 160, 192, 76, 161, 237, 45, 4, 58, 10, 182, 65, 202, 240, 185, 241, 79, 224, 132, 51, 42, 126, 105, 37, 250, 149, 32, 243, 231, 67, 179, 48, 9, 106, 216, 31, 249, 19, 85, 254, 156, 115, 255, 120, 75, 16} - SetDefaultCipher("") - cipher, _ := NewCipher("foobar!") + cipher, _ := NewCipher("", "foobar!") tbl, _ := cipher.(*TableCipher) checkTable(t, tbl, enc, dec, "Error for password foobar!") } @@ -28,7 +27,7 @@ func TestEncrypTable1(t *testing.T) { func TestEncryptTable2(t *testing.T) { enc := []byte{124, 30, 170, 247, 27, 127, 224, 59, 13, 22, 196, 76, 72, 154, 32, 209, 4, 2, 131, 62, 101, 51, 230, 9, 166, 11, 99, 80, 208, 112, 36, 248, 81, 102, 130, 88, 218, 38, 168, 15, 241, 228, 167, 117, 158, 41, 10, 180, 194, 50, 204, 243, 246, 251, 29, 198, 219, 210, 195, 21, 54, 91, 203, 221, 70, 57, 183, 17, 147, 49, 133, 65, 77, 55, 202, 122, 162, 169, 188, 200, 190, 125, 63, 244, 96, 31, 107, 106, 74, 143, 116, 148, 78, 46, 1, 137, 150, 110, 181, 56, 95, 139, 58, 3, 231, 66, 165, 142, 242, 43, 192, 157, 89, 175, 109, 220, 128, 0, 178, 42, 255, 20, 214, 185, 83, 160, 253, 7, 23, 92, 111, 153, 26, 226, 33, 176, 144, 18, 216, 212, 28, 151, 71, 206, 222, 182, 8, 174, 205, 201, 152, 240, 155, 108, 223, 104, 239, 98, 164, 211, 184, 34, 193, 14, 114, 187, 40, 254, 12, 67, 93, 217, 6, 94, 16, 19, 82, 86, 245, 24, 197, 134, 132, 138, 229, 121, 5, 235, 238, 85, 47, 103, 113, 179, 69, 250, 45, 135, 156, 25, 61, 75, 44, 146, 189, 84, 207, 172, 119, 53, 123, 186, 120, 171, 68, 227, 145, 136, 100, 90, 48, 79, 159, 149, 39, 213, 236, 126, 52, 60, 225, 199, 105, 73, 233, 252, 118, 215, 35, 115, 64, 37, 97, 129, 161, 177, 87, 237, 141, 173, 191, 163, 140, 234, 232, 249} dec := []byte{117, 94, 17, 103, 16, 186, 172, 127, 146, 23, 46, 25, 168, 8, 163, 39, 174, 67, 137, 175, 121, 59, 9, 128, 179, 199, 132, 4, 140, 54, 1, 85, 14, 134, 161, 238, 30, 241, 37, 224, 166, 45, 119, 109, 202, 196, 93, 190, 220, 69, 49, 21, 228, 209, 60, 73, 99, 65, 102, 7, 229, 200, 19, 82, 240, 71, 105, 169, 214, 194, 64, 142, 12, 233, 88, 201, 11, 72, 92, 221, 27, 32, 176, 124, 205, 189, 177, 246, 35, 112, 219, 61, 129, 170, 173, 100, 84, 242, 157, 26, 218, 20, 33, 191, 155, 232, 87, 86, 153, 114, 97, 130, 29, 192, 164, 239, 90, 43, 236, 208, 212, 185, 75, 210, 0, 81, 227, 5, 116, 243, 34, 18, 182, 70, 181, 197, 217, 95, 183, 101, 252, 248, 107, 89, 136, 216, 203, 68, 91, 223, 96, 141, 150, 131, 13, 152, 198, 111, 44, 222, 125, 244, 76, 251, 158, 106, 24, 42, 38, 77, 2, 213, 207, 249, 147, 113, 135, 245, 118, 193, 47, 98, 145, 66, 160, 123, 211, 165, 78, 204, 80, 250, 110, 162, 48, 58, 10, 180, 55, 231, 79, 149, 74, 62, 50, 148, 143, 206, 28, 15, 57, 159, 139, 225, 122, 237, 138, 171, 36, 56, 115, 63, 144, 154, 6, 230, 133, 215, 41, 184, 22, 104, 254, 234, 253, 187, 226, 247, 188, 156, 151, 40, 108, 51, 83, 178, 52, 3, 31, 255, 195, 53, 235, 126, 167, 120} - cipher, _ := NewCipher("barfoo!") + cipher, _ := NewCipher("", "barfoo!") tbl, _ := cipher.(*TableCipher) checkTable(t, tbl, enc, dec, "Error for password barfoo!") } @@ -49,10 +48,7 @@ func testCiphter(t *testing.T, c Cipher, msg string) { } func TestTableCipher(t *testing.T) { - if err := SetDefaultCipher(""); err != nil { - t.Error("Error setting default table cipher") - } - cipher, err := NewCipher("OpenSesame!") + cipher, err := NewCipher("", "OpenSesame!") if err != nil { t.Error("Should not get error generating table cipher") } @@ -64,14 +60,11 @@ func TestTableCipher(t *testing.T) { } func TestRC4Cipher(t *testing.T) { - if err := SetDefaultCipher("rc4"); err != nil { - t.Error("Error setting default rc4 cipher") - } - cipher, err := NewCipher("") + cipher, err := NewCipher("rc4", "") if err == nil { t.Error("Should get error for empty key creating rc4 cipher") } - cipher, err = NewCipher("Alibaba") + cipher, err = NewCipher("rc4", "Alibaba") if err != nil { t.Error("Should not error creating rc4 cipher with key Alibaba") } From f75d779b531052d0cec5fd1fe622f5d345eb120d Mon Sep 17 00:00:00 2001 From: Chen Yufei Date: Fri, 15 Mar 2013 14:58:24 +0800 Subject: [PATCH 3/4] Connect to server in order, change server_password to array. Using map to specify multiple servers for client can't preserve the order specified by the user, so changed the configuration to use array. --- cmd/shadowsocks-local/local.go | 78 ++++++++++++++++++-------- sample-config/client-multi-server.json | 8 +-- shadowsocks/config.go | 17 ++++-- shadowsocks/config_test.go | 26 ++++++++- 4 files changed, 93 insertions(+), 36 deletions(-) diff --git a/cmd/shadowsocks-local/local.go b/cmd/shadowsocks-local/local.go index 747af38..b997c19 100644 --- a/cmd/shadowsocks-local/local.go +++ b/cmd/shadowsocks-local/local.go @@ -8,6 +8,7 @@ import ( ss "github.com/shadowsocks/shadowsocks-go/shadowsocks" "io" "log" + "math/rand" "net" "os" "path" @@ -146,10 +147,10 @@ type ServerCipher struct { var servers struct { srvCipher []*ServerCipher - idx uint8 + failCnt []int // failed connection count } -func initServers(config *ss.Config) { +func parseServerConfig(config *ss.Config) { if len(config.ServerPassword) == 0 { // only one encryption table cipher, err := ss.NewCipher(config.Method, config.Password) @@ -170,56 +171,87 @@ func initServers(config *ss.Config) { } } } else { + // multiple servers n := len(config.ServerPassword) servers.srvCipher = make([]*ServerCipher, n) cipherCache := make(map[string]ss.Cipher) i := 0 - for s, passwd := range config.ServerPassword { - if !ss.HasPort(s) { - log.Fatalf("no port for server %s, please specify port in the form of %s:port\n", s, s) + for _, serverInfo := range config.ServerPassword { + if len(serverInfo) < 2 || len(serverInfo) > 3 { + log.Fatalf("server %v syntax error\n", serverInfo) + } + server := serverInfo[0] + passwd := serverInfo[1] + encmethod := "" + if len(serverInfo) == 3 { + encmethod = serverInfo[2] + } + if !ss.HasPort(server) { + log.Fatalf("no port for server %s, please specify port in the form of %s:port\n", server, server) } cipher, ok := cipherCache[passwd] if !ok { var err error - cipher, err = ss.NewCipher(config.Method, passwd) + cipher, err = ss.NewCipher(encmethod, passwd) if err != nil { log.Fatal("Failed generating ciphers:", err) } cipherCache[passwd] = cipher } - servers.srvCipher[i] = &ServerCipher{s, cipher} + servers.srvCipher[i] = &ServerCipher{server, cipher} i++ } } + servers.failCnt = make([]int, len(servers.srvCipher)) for _, se := range servers.srvCipher { log.Println("available remote server", se.server) } return } -// select one server to connect in round robin order -func createServerConn(rawaddr []byte, addr string) (remote *ss.Conn, err error) { - n := len(servers.srvCipher) - if n == 1 { - se := servers.srvCipher[0] - debug.Printf("connecting to %s via %s\n", addr, se.server) - return ss.DialWithRawAddr(rawaddr, se.server, se.cipher.Copy()) +func connectToServer(serverId int, rawaddr []byte, addr string) (remote *ss.Conn, err error) { + se := servers.srvCipher[serverId] + remote, err = ss.DialWithRawAddr(rawaddr, se.server, se.cipher.Copy()) + if err != nil { + log.Println("error connecting to shadowsocks server:", err) + const maxFailCnt = 50 + if servers.failCnt[serverId] < maxFailCnt { + servers.failCnt[serverId]++ + } + return nil, err } + debug.Printf("connected to %s via %s\n", addr, se.server) + servers.failCnt[serverId] = 0 + return +} - id := servers.idx - servers.idx++ // it's ok for concurrent update +// Connection to the server in the order specified in the config. On +// connection failure, try the next server. A failed server will be tried with +// some probability according to its fail count, so we can discover recovered +// servers. +func createServerConn(rawaddr []byte, addr string) (remote *ss.Conn, err error) { + n := len(servers.srvCipher) + skipped := make([]int, 0) for i := 0; i < n; i++ { - se := servers.srvCipher[(int(id)+i)%n] - remote, err = ss.DialWithRawAddr(rawaddr, se.server, se.cipher.Copy()) + // skip failed server, but try it with some probability + if servers.failCnt[i] > 0 && rand.Intn(servers.failCnt[i]+1) != 0 { + skipped = append(skipped, i) + continue + } + remote, err = connectToServer(i, rawaddr, addr) if err == nil { - debug.Printf("connected to %s via %s\n", addr, se.server) return - } else { - log.Println("error connecting to shadowsocks server:", err) } } - return + // last resort, try skipped servers, not likely to succeed + for _, i := range skipped { + remote, err = connectToServer(i, rawaddr, addr) + if err == nil { + return + } + } + return nil, err } func handleConnection(conn net.Conn) { @@ -354,7 +386,7 @@ func main() { } } - initServers(config) + parseServerConfig(config) run(strconv.Itoa(config.LocalPort)) } diff --git a/sample-config/client-multi-server.json b/sample-config/client-multi-server.json index 0a16c62..3b534e1 100644 --- a/sample-config/client-multi-server.json +++ b/sample-config/client-multi-server.json @@ -1,7 +1,7 @@ { "local_port":1081, - "server_password": { - "127.0.0.1:8387": "foobar", - "127.0.0.1:8388": "barfoo" - } + "server_password": [ + ["127.0.0.1:8387", "foobar"], + ["127.0.0.1:8388", "barfoo", "rc4"] + ] } diff --git a/shadowsocks/config.go b/shadowsocks/config.go index 1cb32a2..53c703e 100644 --- a/shadowsocks/config.go +++ b/shadowsocks/config.go @@ -11,7 +11,7 @@ import ( "encoding/json" "fmt" "io/ioutil" - "log" + // "log" "os" "reflect" "time" @@ -29,7 +29,10 @@ type Config struct { Timeout int `json:"timeout"` // following options are only used by client - ServerPassword map[string]string `json:"server_password"` + + // The order of servers in the client config is significant, so use array + // instead of map to preserve the order. + ServerPassword [][]string `json:"server_password"` } var readTimeout time.Duration @@ -46,10 +49,12 @@ func (config *Config) GetServerArray() []string { } arr, ok := config.Server.([]interface{}) if ok { - if len(arr) > 1 { - log.Println("Multiple servers in \"server\" option is deprecated. " + - "Please use \"server_password\" instead.") - } + /* + if len(arr) > 1 { + log.Println("Multiple servers in \"server\" option is deprecated. " + + "Please use \"server_password\" instead.") + } + */ serverArr := make([]string, len(arr), len(arr)) for i, s := range arr { serverArr[i], ok = s.(string) diff --git a/shadowsocks/config_test.go b/shadowsocks/config_test.go index 4476b88..ba495a3 100644 --- a/shadowsocks/config_test.go +++ b/shadowsocks/config_test.go @@ -64,9 +64,29 @@ func TestClientMultiServerArray(t *testing.T) { t.Fatal("error parsing client-multi-server.json:", err) } - if config.ServerPassword["127.0.0.1:8387"] != "foobar" || - config.ServerPassword["127.0.0.1:8388"] != "barfoo" { - t.Error("server_password parse error") + sv := config.ServerPassword[0] + if len(sv) != 2 { + t.Fatalf("server_password 1st server wrong, have %d items\n", len(sv[0])) + } + if sv[0] != "127.0.0.1:8387" { + t.Error("server_password 1st server wrong") + } + if sv[1] != "foobar" { + t.Error("server_password 1st server passwd wrong") + } + + sv = config.ServerPassword[1] + if len(sv) != 3 { + t.Fatalf("server_password 2nd server wrong, have %d items\n", len(sv[0])) + } + if sv[0] != "127.0.0.1:8388" { + t.Error("server_password 2nd server wrong") + } + if sv[1] != "barfoo" { + t.Error("server_password 2nd server passwd wrong") + } + if sv[2] != "rc4" { + t.Error("server_password 2nd server enc method wrong") } } From fc7ed47e5f2d5aa9d7ae29c2e6b17d5632de9e46 Mon Sep 17 00:00:00 2001 From: Chen Yufei Date: Fri, 15 Mar 2013 15:41:28 +0800 Subject: [PATCH 4/4] Bump version to 0.6.2 --- CHANGELOG | 4 ++++ README.md | 4 +++- shadowsocks/util.go | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index f87e98e..1bc2e43 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +0.6.1 (2013-03-15) + * Connect to multiple servers in the order specified in config + * More information in server error log to help error diagnosing + 0.6.1 (2013-03-04) * Small performance improvement * For windows: provide shadowsocks-tray.exe to hide shadowsocks-local.exe in diff --git a/README.md b/README.md index b816d8c..2840a8f 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,13 @@ # shadowsocks-go -Current version: 0.6.1 [![Build Status](https://travis-ci.org/shadowsocks/shadowsocks-go.png?branch=develop)](https://travis-ci.org/shadowsocks/shadowsocks-go) +Current version: 0.6.2 [![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). The protocol is compatible with the origin shadowsocks (if both have been upgraded to the latest version). +**Note `server_password` option syntax changed in 0.6.2, the client now connects to servers in the order specified in the config.** + # Install Compiled client binaries are provided on [google code](http://code.google.com/p/shadowsocks-go/downloads/list). (Compiled with cgo disabled.) diff --git a/shadowsocks/util.go b/shadowsocks/util.go index 95ba7e1..0b95e7e 100644 --- a/shadowsocks/util.go +++ b/shadowsocks/util.go @@ -7,7 +7,7 @@ import ( ) func PrintVersion() { - const version = "0.6.1" + const version = "0.6.2" fmt.Println("shadowsocks-go version", version) }