mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #845] frp是否支持Server Sent Events(SSE)? #666
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#666
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 @chinason on GitHub (Jun 30, 2018).
Original GitHub issue: https://github.com/fatedier/frp/issues/845
Issue is only used for submiting bug report and documents typo. If there are same issues or answers can be found in documents, we will close it directly.
(为了节约时间,提高处理问题的效率,不按照格式填写的 issue 将会直接关闭。)
Use the commands below to provide key information from your environment:
You do NOT have to include this information if this is a FEATURE REQUEST
What version of frp are you using (./frpc -v or ./frps -v)?
0.20.0
What operating system and processor architecture are you using (
go env)?Windows10 AMD64
Configures you used:
frpc.ini
[common]
server_addr = 127.0.0.1
server_port = 7000
[web]
type = http
local_ip = 127.0.0.1
local_port = 8000
use_encryption = false
use_compression = false
subdomain = test
Steps to reproduce the issue:
Describe the results you received:
SSE请求长时间没有应答,最终超时。
Describe the results you expected:
frp可以支持SSE。
Additional information you deem important (e.g. issue happens only occasionally):
Can you point out what caused this issue (optional)
对于SSE响应(响应头中有Content-Type: text/event-stream),一直等待返回结果。
像nginx作为反向代理时,如果SSE服务返回的响应头中有 X-Accel-Buffering: no时就可以支持SSE。
@fatedier commented on GitHub (Jul 30, 2018):
不是很了解这个使用姿势,但是对于一些特殊的 case,可以考虑直接使用 tcp 的类型。
@chinason commented on GitHub (Aug 4, 2018):
嗯。主要是环境不支持webSocket,又不想使用longPolling方式。
参照webSocket的写法修改了一下utils/vhost/reverseproxy.go。目前测试没什么问题。
@chengjianhua commented on GitHub (Nov 15, 2018):
@chinason 请问下你是如何修改支持 SSE 的呢, 我也正有这样的需求, 废了大半天的劲才发现是 frp 代理的问题...
@fatedier 请问下如何能够让 frp 支持 SSE 呢
@fatedier commented on GitHub (Dec 8, 2018):
@chengjianhua 没有计划支持这个,如果 @chinason 能提供 PR,不影响正常 http 请求的话,可以考虑。
@chinason commented on GitHub (Jan 18, 2019):
不好意思才看到,不知还有没有用。
修改了这个文件: utils/vhost/reverseproxy.go
附件是修改后的文件。
注:使用中发现会有很多连接一直建立着,而不断开,目前不知道是不是SSE连接导致的。
reverseproxy.zip
@oldthreefeng commented on GitHub (Feb 18, 2020):
废了大半天的劲才发现是 frp 代理的问题.. 唉哟,nginx配置都配到天上去了。
@ufofuduo commented on GitHub (May 13, 2023):
您好!最新的版本支持SSE了吗?
@pccai commented on GitHub (May 19, 2023):
同问,Server-Sent Events支持吗? gpt4带来的打字效果没有了。。
@chinason commented on GitHub (Jun 2, 2023):
目前我用的是 v0.29.1,已经支持SSE。
我想最新版本的应该也支持。
@pccai commented on GitHub (Jun 2, 2023):
我用的是0.48,不支持。
@chinason commented on GitHub (Jun 2, 2023):
我安装测试了一下0.48版本的,支持SSE。
服务器端运行在windows上,客户端运行在arm llinux上。
@ninghongbo123 commented on GitHub (Jun 16, 2023):
我后端是websocket接口。请问frps和frpc要如何配置,才能支持接口转发。
看了许多帖子,都解决不了。
还望大佬指点一下。
@reply2future commented on GitHub (Jul 5, 2023):
我使用
tcp是可以的,使用http是不行的。@chengkunchen commented on GitHub (Jul 21, 2023):
@chengkunchen commented on GitHub (Jul 21, 2023):
websocket 不用做特殊处理,就tcp方式就可以,nginx要做一些配置
@sizzlecar commented on GitHub (Jul 30, 2023):
If it is forwarded to frp through nginx and includes SSE request, then nginx needs to add the following configuration as follows
`
proxy_set_header Connection '';
proxy_http_version 1.1;
chunked_transfer_encoding off;
proxy_buffering off;
proxy_cache off;
proxy_set_header Host $host;
`