Skip to content

Commit 2949ea2

Browse files
authored
Merge pull request #305 from bjdgyc/dev
修复心跳时间
2 parents bdc8e26 + 11f39d0 commit 2949ea2

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

server/base/config.go

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

server/conf/server-sample.toml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,16 @@ ip_lease = 86400
6565
default_group = "one"
6666

6767
#客户端失效检测时间(秒) dpd > keepalive
68-
#cstp_keepalive = 5
69-
#cstp_dpd = 12
70-
#mobile_keepalive = 10
71-
#mobile_dpd = 22
72-
cstp_keepalive = 20
73-
cstp_dpd = 30
74-
mobile_keepalive = 40
75-
mobile_dpd = 60
68+
cstp_keepalive = 3
69+
cstp_dpd = 10
70+
mobile_keepalive = 4
71+
mobile_dpd = 15
72+
73+
# 根据实际情况修改
74+
#cstp_keepalive = 20
75+
#cstp_dpd = 30
76+
#mobile_keepalive = 40
77+
#mobile_dpd = 60
7678

7779
#设置最大传输单元
7880
mtu = 1460

server/handler/link_tunnel.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ func LinkTunnel(w http.ResponseWriter, r *http.Request) {
181181
HttpSetHeader(w, "X-CSTP-Quarantine", "false")
182182
HttpSetHeader(w, "X-CSTP-Disable-Always-On-VPN", "false")
183183
HttpSetHeader(w, "X-CSTP-Client-Bypass-Protocol", "false")
184-
HttpSetHeader(w, "X-CSTP-TCP-Keepalive", "true")
184+
HttpSetHeader(w, "X-CSTP-TCP-Keepalive", "false")
185185
// 设置域名拆分隧道(移动端不支持)
186186
if mobile != "mobile" {
187187
SetPostAuthXml(cSess.Group, w)

0 commit comments

Comments
 (0)