-
Notifications
You must be signed in to change notification settings - Fork 844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Server-sent-events are buffered. #199
Comments
@chungthuang I'm seeing this as well using 2020.11.9 |
I've tested SSE works with our hello-world server https://github.com/cloudflare/cloudflared/blob/master/hello/hello.go#L190. Can you share another simple server I can test with? |
I can reproduce this exact issue on my setup (Python + current version of Gunicorn, Waitress). I see this with a "regular" webpage being server ( These are the headers I receive connecting directly to the server process:
Note the These are the headers when going through Argo:
In this case, the data still loads incrementally, however with much larger buffer size. (I don't know how to measure exactly.) |
having a similar issue attempting this with Apache/PHP-FPM sitting in front of the Tunnel. When I check the response via ngrok tunnel or directly it works as expected but as soon I put CloudFlare in front of it (either via tunnel or traditionally via the CDN proxying the origin), it seems to be buffering 3-4K before sending each "chunk" even though we're using the "no chunked encoding" option. this issue has been unresolved for almost 2 years now, any workarounds anyone found? |
something to be mentioned here is that we're sending standard |
ie: specify flushableContentTypes overrides via cli parameter or config? |
I'm having trouble with SSE getting buffered, i.e. the header content-type is set to |
Having the same trying to stream logs when proxying Nomad with Cloudflared. Works fine when proxied through Cloudflare normally. Related: hashicorp/nomad#5404 (comment) |
Same issue with https://connect.build We use gRPC server streams extensively, and this issue is a blocker. |
I am having the same issue with the latest version of cloudflared. |
I had same problem in .NET core implementation of SSE. |
I believe I encounter the same issue with React 18 streaming |
Hey guys, did anyone manage to find a fix of this issue? |
Came across this issue via a support ticket. I would ensure that that we're using:
|
This is the answer. Add the header to your response and SSE will work as expected. Just tested it on a project that was facing this exact issue. |
I haven't tested this in awhile so maybe it works now, but I just wanted to point out that per the original post this was not working even when including the |
We just ran an experiment by forking cloudflared and it's not just the Testing via a request that reports |
How about |
The same as #1018 |
I have found a workaround for this, since I was also having similar issues. I'm running a Git-like service (https://github.com/xorrvin/gitoboros) which uses Chunked encoding and outputs some info in a stream. It's proxied by nginx. I'm using default settings for the tunnel. The solution has two steps. First, you need to mask original content type header (in my case
Then, you need to go to your Cloudflare Dashboard, and set up few rules for that specific endpoint:
That's it! |
@xorrvin It works as expected. Thank you for the suggestion. I use a
Then magic happens, response is not buffered anymore |
In my case setting the HTTP header for |
I've been having difficulty streaming responses to clients using Server-Sent Events (SSE) while using Argo.
Argo (or Cloudflare) appears to be doing some sort of buffering that is preventing data from being streamed to clients incrementally.
Is there any way to opt out of this behavior?
For example, the following ExpressJS route (which sends an incrementing number to the client every 10ms) behaves very differently depending upon whether it's accessed directly or via an Argo tunnel.
cURLing this route directly:
cURLing this route over an Argo tunnel:
(Client on left – Server on right)
The text was updated successfully, but these errors were encountered: