Skip to content

Commit

Permalink
Add multi-port config example.
Browse files Browse the repository at this point in the history
  • Loading branch information
cyfdecyf committed Dec 14, 2012
1 parent 2cb7cde commit 374ca4f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/shadowsocks-server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ func main() {
if config.ServerPort != 0 {
log.Println("ignoring server_port and password option, only uses port_password")
}
c := make(chan byte)
for port, password := range config.PortPassword {
go run(port, password)
}
Expand All @@ -170,6 +169,7 @@ func main() {
}
log.Println("all ports ready")
tableCache = nil // release memory
c := make(chan byte)
<-c // block forever
}
}
4 changes: 4 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
"server_port":8388,
"local_port":1080,
"password":"barfoo!",
"port_password": {
"8388": "barfoo!",
"8387": "foobar!"
},
"timeout":60,
"debug":true
}

0 comments on commit 374ca4f

Please sign in to comment.