From 0791d03bd948fc35ef5201924f4a025a32d8fd51 Mon Sep 17 00:00:00 2001 From: srgooglo Date: Fri, 13 May 2022 09:53:55 +0200 Subject: [PATCH] write head on stream flv mode --- packages/streaming-server/src/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/streaming-server/src/index.js b/packages/streaming-server/src/index.js index c373ffa0..5869f130 100644 --- a/packages/streaming-server/src/index.js +++ b/packages/streaming-server/src/index.js @@ -25,7 +25,7 @@ const MediaServerConfig = { }, http: { port: 1000, - allow_origin: '*' + allow_origin: "*" }, trans: { ffmpeg: ffmpeg.path, @@ -212,6 +212,11 @@ class StreamingServer { // create a buffer stream from the request const bufferStream = request.data.pipe(new stream.PassThrough()) + res.writeHead(200, { + "Cache-Control": "no-cache", + "Connection": "keep-alive" + }) + // pipe the buffer stream to the response bufferStream.on("data", (chunk) => { res.write(chunk)