[GH-ISSUE #2841] http请求超过10s自动中断 #2270

Closed
opened 2026-05-05 13:27:48 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @linyuanzi on GitHub (Mar 14, 2022).
Original GitHub issue: https://github.com/fatedier/frp/issues/2841

Bug Description

场景:

我尝试通过frp代理我内网的lnmp服务。

问题:

发现http请求10s会自动中断;

尝试排查问题:

  1. 我尝试从内部服务中寻找问题,检测了php和nginx的服务超时机制,都没有发现问题。
  2. 尝试单独用gin启动一个web服务,并直接通过frp进行代理(不使用php和nginx),发现依旧是10s自动中断。内网直接反问是可以超过10s的。(所以我这边判定是frp的服务中断限制)

尝试修改frp配置:

frps(服务端)补充了如下参数:

[common]
user_conn_timeout = 300
vhost_http_timeout = 300
heartbeat_timeout = 900

frpc(服务端)补充了如下参数:

[web]
health_check_interval_s = 300
health_check_max_failed = 3
health_check_timeout_s = 15
[common]
heartbeat_interval = 30
heartbeat_timeout = 90

frp配置的调整依旧没有使接口恢复正常请求。

frpc Version

0.39.0

frps Version

0.39.0

System Architecture

linux/amd64,

Configurations

frpc

[common]
server_addr = domain.com
server_port = 7000
heartbeat_interval = 30
heartbeat_timeout = 90

health_check_interval_s=30

#公网访问内部web服务器以http方式
[web]
#访问协议
type = http
#内网web服务的端口号
local_port = 80
#所绑定的公网服务器域名,一级、二级域名都可以
custom_domains = *.domain.com
health_check_interval_s = 300
health_check_max_failed = 3
health_check_timeout_s = 15

[goweb]
type = http
local_port = 8088
custom_domains = golang.domain.com

frps

[common]
#与客户端绑定的进行通信的端口
bind_port = 7000
#访问客户端web服务自定义的端口号
vhost_http_port = 6081
user_conn_timeout = 300
vhost_http_timeout = 300
heartbeat_timeout = 900

# console or real logFile path like ./frps.log
log_file = ./frps.log

# trace, debug, info, warn, error
log_level = info

log_max_days = 3

# disable log colors when log_file is console, default is false
disable_log_color = false

Logs

2022/03/14 16:10:37 [W] [http.go:92] do http proxy request error: context canceled

Steps to reproduce

...

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @linyuanzi on GitHub (Mar 14, 2022). Original GitHub issue: https://github.com/fatedier/frp/issues/2841 ### Bug Description ## 场景: 我尝试通过frp代理我内网的lnmp服务。 ## 问题: 发现http请求10s会自动中断; ## 尝试排查问题: 1. 我尝试从内部服务中寻找问题,检测了php和nginx的服务超时机制,都没有发现问题。 2. 尝试单独用gin启动一个web服务,并直接通过frp进行代理(不使用php和nginx),发现依旧是10s自动中断。内网直接反问是可以超过10s的。(所以我这边判定是frp的服务中断限制) ## 尝试修改frp配置: frps(服务端)补充了如下参数: ``` [common] user_conn_timeout = 300 vhost_http_timeout = 300 heartbeat_timeout = 900 ``` frpc(服务端)补充了如下参数: ``` [web] health_check_interval_s = 300 health_check_max_failed = 3 health_check_timeout_s = 15 [common] heartbeat_interval = 30 heartbeat_timeout = 90 ``` frp配置的调整依旧没有使接口恢复正常请求。 ### frpc Version 0.39.0 ### frps Version 0.39.0 ### System Architecture linux/amd64, ### Configurations ## frpc ``` [common] server_addr = domain.com server_port = 7000 heartbeat_interval = 30 heartbeat_timeout = 90 health_check_interval_s=30 #公网访问内部web服务器以http方式 [web] #访问协议 type = http #内网web服务的端口号 local_port = 80 #所绑定的公网服务器域名,一级、二级域名都可以 custom_domains = *.domain.com health_check_interval_s = 300 health_check_max_failed = 3 health_check_timeout_s = 15 [goweb] type = http local_port = 8088 custom_domains = golang.domain.com ``` ## frps ``` [common] #与客户端绑定的进行通信的端口 bind_port = 7000 #访问客户端web服务自定义的端口号 vhost_http_port = 6081 user_conn_timeout = 300 vhost_http_timeout = 300 heartbeat_timeout = 900 # console or real logFile path like ./frps.log log_file = ./frps.log # trace, debug, info, warn, error log_level = info log_max_days = 3 # disable log colors when log_file is console, default is false disable_log_color = false ``` ### Logs 2022/03/14 16:10:37 [W] [http.go:92] do http proxy request error: context canceled ### Steps to reproduce 1. 2. 3. ... ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [ ] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [X] Others
Author
Owner

@linyuanzi commented on GitHub (Mar 14, 2022):

发现是我的ClashX影响了

<!-- gh-comment-id:1066558553 --> @linyuanzi commented on GitHub (Mar 14, 2022): 发现是我的ClashX影响了
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#2270
No description provided.