Skip to content

Commit 2dff163

Browse files
committed
调整默认超时设置
1 parent d5300b3 commit 2dff163

6 files changed

Lines changed: 21 additions & 21 deletions

File tree

cmd/npc/npc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ var (
6363
stunAddr = flag.String("stun_addr", "stun.miwifi.com:3478", "STUN server address")
6464
protoVer = flag.Int("proto_version", version.GetLatestIndex(), fmt.Sprintf("Protocol version (0-%d)", version.GetLatestIndex()))
6565
skipVerify = flag.Bool("skip_verify", false, "Skip verification of server certificate")
66-
disconnectTime = flag.Int("disconnect_timeout", 60, "Disconnect timeout in seconds")
66+
disconnectTime = flag.Int("disconnect_timeout", 30, "Disconnect timeout in seconds")
6767
keepAlive = flag.Int("keepalive", 0, "KeepAlive Period in seconds")
6868
p2pTime = flag.Int("p2p_timeout", 5, "P2P timeout in seconds")
6969
dnsServer = flag.String("dns_server", "8.8.8.8", "DNS server for domain lookup")

cmd/nps/nps.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ func run() {
310310
crypt.InitTls(cert)
311311
tool.InitAllowPort()
312312
tool.StartSystemInfo()
313-
timeout := beego.AppConfig.DefaultInt("disconnect_timeout", 60)
313+
timeout := beego.AppConfig.DefaultInt("disconnect_timeout", 30)
314314
bridgeType := beego.AppConfig.DefaultString("bridge_type", "both")
315315
bridge.ServerKcpEnable = beego.AppConfig.DefaultBool("kcp_enable", true) && connection.BridgeKcpPort != 0 && (bridgeType == "kcp" || bridgeType == "udp" || bridgeType == "both")
316316
bridge.ServerQuicEnable = beego.AppConfig.DefaultBool("quic_enable", true) && connection.BridgeQuicPort != 0 && (bridgeType == "quic" || bridgeType == "udp" || bridgeType == "both")

conf/npc.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ auto_reconnection=true
1717
#crypt=true
1818
#compress=true
1919
#pprof_addr=0.0.0.0:9999
20-
#disconnect_timeout=60
20+
#disconnect_timeout=30
2121

2222
#[health_check_test1]
2323
#health_check_timeout=1

conf/nps.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ public_vkey=
8989
p2p_ip=0.0.0.0
9090
p2p_port=6000
9191

92-
# 客户端断开连接超时时间(60*30秒)
93-
disconnect_timeout=60
92+
# 客户端断开连接超时时间(30秒)
93+
disconnect_timeout=30
9494

9595
#############################################
9696
# 允许端口范围配置(可选)

docs/npc_extend.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ proxy_url=socks5://111:222@127.0.0.1:8024
9595
| `-log_max_size` | 单个日志文件最大大小(MB) | `5` |
9696
| `-log_color` | 控制台输出启用 ANSI 彩色 | `true` |
9797
| `-auto_reconnect` | 断线后自动重连 | `true` |
98-
| `-disconnect_timeout` | 连接超时秒数 | `60` |
98+
| `-disconnect_timeout` | 连接超时秒数 | `30` |
9999
| `-keepalive` | 保活(KeepAlive)周期(秒) | 默认 |
100100
| `-pprof` | 启用 PProf 调试(格式 `ip:port`||
101101
| `-local_type` | P2P 目标类型 | `p2p` |

docs/server_config.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -187,21 +187,21 @@ server {
187187
---
188188

189189
## 9. 其他高级配置
190-
| 名称 | 说明 |
191-
|------------------------------|-------------------------------------------|
192-
| `allow_flow_limit` | 是否允许流量限制 |
193-
| `allow_rate_limit` | 是否允许带宽限制 |
194-
| `allow_time_limit` | 是否允许到期时间限制 |
195-
| `allow_tunnel_num_limit` | 是否允许限制客户端最大隧道数 |
196-
| `allow_local_proxy` | 是否允许 NPS 本地代理连接(相当于在nps服务器上启动一个npc) |
197-
| `allow_user_local` | 是否允许用户使用 NPS 本地代理连接 |
198-
| `allow_secret_link` | 是否允许私密代理客户端指定连接地址 |
199-
| `allow_secret_local` | 是否允许私密代理客户端连接到服务器本地 |
200-
| `allow_connection_num_limit` | 是否限制客户端最大连接数 |
201-
| `allow_multi_ip` | 是否允许配置隧道监听IP地址 |
202-
| `system_info_display` | 是否显示系统负载监控信息 |
203-
| `disconnect_timeout` | TCP 中断超时等待时间(单位 5s,默认值 60,即 300s = 5mins) |
204-
| `http_cache` | 是否启用 HTTP 缓存(已弃用,不再支持该功能) |
190+
| 名称 | 说明 |
191+
|------------------------------|-------------------------------------|
192+
| `allow_flow_limit` | 是否允许流量限制 |
193+
| `allow_rate_limit` | 是否允许带宽限制 |
194+
| `allow_time_limit` | 是否允许到期时间限制 |
195+
| `allow_tunnel_num_limit` | 是否允许限制客户端最大隧道数 |
196+
| `allow_local_proxy` | 是否允许 NPS 本地代理连接(相当于在nps服务器上启动一个npc) |
197+
| `allow_user_local` | 是否允许用户使用 NPS 本地代理连接 |
198+
| `allow_secret_link` | 是否允许私密代理客户端指定连接地址 |
199+
| `allow_secret_local` | 是否允许私密代理客户端连接到服务器本地 |
200+
| `allow_connection_num_limit` | 是否限制客户端最大连接数 |
201+
| `allow_multi_ip` | 是否允许配置隧道监听IP地址 |
202+
| `system_info_display` | 是否显示系统负载监控信息 |
203+
| `disconnect_timeout` | TCP 中断超时等待时间(单位 s,默认值 30s) |
204+
| `http_cache` | 是否启用 HTTP 缓存(已弃用,不再支持该功能) |
205205

206206
---
207207

0 commit comments

Comments
 (0)