mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #2469] HTTP 代理插件似乎不支持 TCP 连接重用(Connection: keep-alive) #1961
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#1961
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @luangong on GitHub (Jul 5, 2021).
Original GitHub issue: https://github.com/fatedier/frp/issues/2469
使用的 frp 版本
0.37.0
操作系统版本与架构
服务端:Windows 10 (64-bit)
客户端:Windows 7 (32-bit)
问题描述
http_proxy插件似乎不支持 HTTP/1.1 的 TCP 连接重用机制(Connection: keep-alive)。例如在中国大陆用浏览器访问 www.bing.com 会被 301 重定向到 cn.bing.com,如果通过curl命令向 www.bing.com 发送请求,frp 的http_proxy插件成功地返回了301 Moved Permanently,但是当curl尝试重用与 frp 的 TCP 连接继续请求 cn.bing.com 时 frp 返回500 Internal Server Error。虽然目前 Chrome 浏览器访问 www.bing.com 能正常重定向到 cn.bing.com,但是其他 HTTP 客户端可能会因为尝试重用与代理服务器的 TCP 连接而遭到拒绝,例如 Ubuntu 里 apt 更新软件包就会报 500 错误,其他客户端我没有试过,就不一一列举了。
具体错误信息如下:
显示以上截图的文字内容(HTTP/1.1)
注意上面加粗的部分。
如果在命令行参数中强制使用 HTTP/1.0 或指定
Connection: close则一切正常:显示以上截图的文字内容(HTTP/1.0)
显示以上截图的文字内容(
Connection: close)配置文件内容
服务器端配置文件
frps.ini:客户端配置文件
frpc.ini:日志文件内容
服务器端日志
frps.log客户端日志
frpc.log重现问题的步骤
plugin = http_proxy并通知服务器端监听 1080 端口(remote_port = 1080)作为 HTTP 代理curl -vfsSL --proxy http://localhost:1080 http://www.bing.com > /dev/null,控制台输出500 Internal Server Error@fatedier commented on GitHub (Jul 5, 2021):
这个问题是由于使用了 yamux 库导致,给这个库提了一个 fix PR https://github.com/hashicorp/yamux/pull/91 ,合入后可以解决这个问题,如果不能被合入,会考虑在 frp 自身中做一层包装来解决。