Skip to content

Commit edf33ba

Browse files
committed
修复mac手机版客户端重连的问题
1 parent 03467e4 commit edf33ba

File tree

9 files changed

+69
-60
lines changed

9 files changed

+69
-60
lines changed

server/admin/api_base.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ func authMiddleware(next http.Handler) http.Handler {
8484
w.Header().Set("Access-Control-Allow-Methods", "GET,POST,OPTIONS")
8585
w.Header().Set("Access-Control-Allow-Headers", "*")
8686
if r.Method == http.MethodOptions {
87+
// w.WriteHeader(http.StatusOK)
8788
// 正式环境不支持 OPTIONS
8889
w.WriteHeader(http.StatusForbidden)
8990
return

server/base/config.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ var configs = []config{
5353
{Typ: cfgInt, Name: "ip_lease", Usage: "IP租期(秒)", ValInt: 86400},
5454
{Typ: cfgInt, Name: "max_client", Usage: "最大用户连接", ValInt: 200},
5555
{Typ: cfgInt, Name: "max_user_client", Usage: "最大单用户连接", ValInt: 3},
56-
{Typ: cfgInt, Name: "cstp_keepalive", Usage: "keepalive时间(秒)", ValInt: 5},
57-
{Typ: cfgInt, Name: "cstp_dpd", Usage: "死链接检测时间(秒)", ValInt: 12},
58-
{Typ: cfgInt, Name: "mobile_keepalive", Usage: "移动端keepalive接检测时间(秒)", ValInt: 10},
59-
{Typ: cfgInt, Name: "mobile_dpd", Usage: "移动端死链接检测时间(秒)", ValInt: 22},
56+
{Typ: cfgInt, Name: "cstp_keepalive", Usage: "keepalive时间(秒)", ValInt: 20},
57+
{Typ: cfgInt, Name: "cstp_dpd", Usage: "死链接检测时间(秒)", ValInt: 30},
58+
{Typ: cfgInt, Name: "mobile_keepalive", Usage: "移动端keepalive接检测时间(秒)", ValInt: 40},
59+
{Typ: cfgInt, Name: "mobile_dpd", Usage: "移动端死链接检测时间(秒)", ValInt: 60},
6060
{Typ: cfgInt, Name: "mtu", Usage: "最大传输单元MTU", ValInt: 1460},
6161
{Typ: cfgInt, Name: "idle_timeout", Usage: "空闲链接超时时间(秒)-超时后断开链接,0关闭此功能", ValInt: 1800},
6262
{Typ: cfgInt, Name: "session_timeout", Usage: "session过期时间(秒)-用于断线重连,0永不过期", ValInt: 3600},

server/conf/server-sample.toml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,14 @@ ip_lease = 86400
6161
default_group = "one"
6262

6363
#客户端失效检测时间(秒) dpd > keepalive
64-
cstp_keepalive = 5
65-
cstp_dpd = 12
66-
mobile_keepalive = 10
67-
mobile_dpd = 22
64+
#cstp_keepalive = 5
65+
#cstp_dpd = 12
66+
#mobile_keepalive = 10
67+
#mobile_dpd = 22
68+
cstp_keepalive = 20
69+
cstp_dpd = 30
70+
mobile_keepalive = 40
71+
mobile_dpd = 60
6872

6973
#设置最大传输单元
7074
mtu = 1460

server/go.mod

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/go-acme/lego/v4 v4.15.0
99
github.com/go-co-op/gocron v1.37.0
1010
github.com/go-ldap/ldap v3.0.3+incompatible
11-
github.com/go-sql-driver/mysql v1.7.1
11+
github.com/go-sql-driver/mysql v1.8.0
1212
github.com/gocarina/gocsv v0.0.0-20231116093920-b87c2d0e983a
1313
github.com/golang-jwt/jwt/v4 v4.5.0
1414
github.com/google/gopacket v1.1.19
@@ -32,22 +32,23 @@ require (
3232
github.com/stretchr/testify v1.8.4
3333
github.com/xhit/go-simple-mail/v2 v2.16.0
3434
github.com/xlzd/gotp v0.1.0
35-
github.com/xuri/excelize/v2 v2.8.0
35+
github.com/xuri/excelize/v2 v2.8.1
3636
go.uber.org/atomic v1.11.0
37-
golang.org/x/crypto v0.19.0
38-
golang.org/x/net v0.21.0
37+
golang.org/x/crypto v0.21.0
38+
golang.org/x/net v0.22.0
3939
golang.org/x/text v0.14.0
4040
golang.org/x/time v0.5.0
4141
layeh.com/radius v0.0.0-20231213012653-1006025d24f8
4242
xorm.io/xorm v1.3.8
4343
)
4444

4545
require (
46-
github.com/aliyun/alibaba-cloud-sdk-go v1.62.680 // indirect
46+
filippo.io/edwards25519 v1.1.0 // indirect
47+
github.com/aliyun/alibaba-cloud-sdk-go v1.62.690 // indirect
4748
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
48-
github.com/cloudflare/cloudflare-go v0.88.0 // indirect
49+
github.com/cloudflare/cloudflare-go v0.89.0 // indirect
4950
github.com/felixge/httpsnoop v1.0.4 // indirect
50-
github.com/go-jose/go-jose/v3 v3.0.1 // indirect
51+
github.com/go-jose/go-jose/v3 v3.0.3 // indirect
5152
github.com/go-test/deep v1.1.0 // indirect
5253
github.com/google/go-querystring v1.1.0 // indirect
5354
github.com/google/uuid v1.6.0 // indirect
@@ -61,14 +62,14 @@ require (
6162
github.com/sagikazarmark/locafero v0.4.0 // indirect
6263
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
6364
github.com/sourcegraph/conc v0.3.0 // indirect
64-
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.860 // indirect
65-
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.860 // indirect
65+
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.873 // indirect
66+
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.873 // indirect
6667
github.com/toorop/go-dkim v0.0.0-20240103092955-90b7d1423f92 // indirect
6768
github.com/yusufpapurcu/wmi v1.2.4 // indirect
6869
go.uber.org/multierr v1.11.0 // indirect
69-
golang.org/x/exp v0.0.0-20240213143201-ec583247a57a // indirect
70-
golang.org/x/mod v0.15.0 // indirect
71-
golang.org/x/tools v0.18.0 // indirect
70+
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect
71+
golang.org/x/mod v0.16.0 // indirect
72+
golang.org/x/tools v0.19.0 // indirect
7273
)
7374

7475
require (
@@ -99,7 +100,7 @@ require (
99100
github.com/tklauser/numcpus v0.7.0 // indirect
100101
github.com/xuri/efp v0.0.0-20231025114914-d1ff6096ae53 // indirect
101102
github.com/xuri/nfp v0.0.0-20230919160717-d98342af3f05 // indirect
102-
golang.org/x/sys v0.17.0 // indirect
103+
golang.org/x/sys v0.18.0 // indirect
103104
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect
104105
gopkg.in/ini.v1 v1.67.0 // indirect
105106
gopkg.in/yaml.v3 v3.0.1 // indirect

0 commit comments

Comments
 (0)