Skip to content

Commit

Permalink
新增配置文件
Browse files Browse the repository at this point in the history
  • Loading branch information
w910820618 committed Jan 13, 2021
1 parent 9feb9b0 commit 4af5bc7
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 3 deletions.
File renamed without changes.
21 changes: 21 additions & 0 deletions conf/server.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"client": "",
"server": "ss://AEAD_CHACHA20_POLY1305:12345@192.168.0.104:8488",
"cipher": "AEAD_CHACHA20_POLY1305",
"key": "",
"password": "",
"keygen": 0,
"socks": "",
"redir_tcp": "",
"redir_tcp_6": "",
"tcp_tun": "",
"udp_tun": "",
"udp_socks": false,
"udp": false,
"tcp": true,
"plugin": "",
"plugin_opts": "",
"verbose": true,
"udp_timeout": "1s",
"tcp_cork": false
}
2 changes: 1 addition & 1 deletion configure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import (
)

func TestConfigure(t *testing.T) {
configure := loadConfigure("/home/wu/go/src/shadowsocks/conf/configure.json")
configure := loadConfigure("/home/wu/go/src/shadowsocks/conf/client.json")
t.Log(configure.UDPTimeout.String())
}
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
func main() {
var flags *Configure

var filePath = flag.String("path", "/etc/shadowsocks/conf.configure.json", "shadowsocks configure file path")
var filePath = flag.String("path", "/etc/shadowsocks/conf.client.json", "shadowsocks configure file path")
flag.Parse()

if flags = loadConfigure(*filePath); flags == nil {
Expand Down
2 changes: 1 addition & 1 deletion tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ func tcpLocal(addr, server string, shadow func(net.Conn) net.Conn, getAddr func(
go func() {
defer c.Close()
tgt, err := getAddr(c)
if err != nil {

if err != nil {
// UDP: keep the connection until disconnect then free the UDP socket
if err == socks.InfoUDPAssociate {
buf := make([]byte, 1)
Expand Down

0 comments on commit 4af5bc7

Please sign in to comment.