write head on stream flv mode

This commit is contained in:
srgooglo 2022-05-13 09:53:55 +02:00
parent 7c39556ae1
commit c11505bacf

View File

@ -25,7 +25,7 @@ const MediaServerConfig = {
}, },
http: { http: {
port: 1000, port: 1000,
allow_origin: '*' allow_origin: "*"
}, },
trans: { trans: {
ffmpeg: ffmpeg.path, ffmpeg: ffmpeg.path,
@ -212,6 +212,11 @@ class StreamingServer {
// create a buffer stream from the request // create a buffer stream from the request
const bufferStream = request.data.pipe(new stream.PassThrough()) 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 // pipe the buffer stream to the response
bufferStream.on("data", (chunk) => { bufferStream.on("data", (chunk) => {
res.write(chunk) res.write(chunk)