From fa32bc49963d020ee3b993b3b3441ff2678fbada Mon Sep 17 00:00:00 2001 From: Arlen22 Date: Sat, 10 Jun 2023 11:25:37 -0400 Subject: [PATCH] add X-Accel-Buffering: no --- dist/plugin.info | 2 +- dist/server-sent-events.js | 2 ++ server-sent-events.ts | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dist/plugin.info b/dist/plugin.info index 75fe2b1..f6f576f 100644 --- a/dist/plugin.info +++ b/dist/plugin.info @@ -5,5 +5,5 @@ "list": "readme", "plugin-priority": 10, "license": "MIT - Copyright Arlen Beiler 2021", - "version": "1.0.2" + "version": "1.0.3" } diff --git a/dist/server-sent-events.js b/dist/server-sent-events.js index 6de777e..36aa390 100644 --- a/dist/server-sent-events.js +++ b/dist/server-sent-events.js @@ -189,6 +189,8 @@ var SSEClient = /** @class */ (function () { "Content-Type": "text/event-stream", "Cache-Control": "no-cache", 'Connection': 'keep-alive', + // According to https://serverfault.com/questions/801628/for-server-sent-events-sse-what-nginx-proxy-configuration-is-appropriate + 'X-Accel-Buffering': 'no', }, headers)); // write the retry interval and event id immediately this.write("", "", eventID); diff --git a/server-sent-events.ts b/server-sent-events.ts index e02ea2e..a3c5e9c 100644 --- a/server-sent-events.ts +++ b/server-sent-events.ts @@ -190,6 +190,8 @@ export class SSEClient implements AnyClient<"stream"> { "Content-Type": "text/event-stream", "Cache-Control": "no-cache", 'Connection': 'keep-alive', + // According to https://serverfault.com/questions/801628/for-server-sent-events-sse-what-nginx-proxy-configuration-is-appropriate + 'X-Accel-Buffering': 'no', }, headers)); // write the retry interval and event id immediately