From 9a53022aa8bd30f04ebabc33295a21f335947432 Mon Sep 17 00:00:00 2001 From: sasha2018rl Date: Mon, 24 Oct 2022 22:37:39 +0300 Subject: [PATCH 1/2] Add server param to socket server --- README.md | 2 ++ videoStream.js | 12 +++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ef60740..683d1ee 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ node-rtsp-stream ================ +**Added support for using exists http server** + Stream any RTSP stream and output to websocket for consumption by [jsmpeg](https://github.com/phoboslab/jsmpeg). HTML5 streaming video! (Requires ffmpeg) Usage: diff --git a/videoStream.js b/videoStream.js index 720cb53..ed958a8 100644 --- a/videoStream.js +++ b/videoStream.js @@ -88,9 +88,15 @@ VideoStream.prototype.startMpeg1Stream = function() { } VideoStream.prototype.pipeStreamToSocketServer = function() { - this.wsServer = new ws.Server({ - port: this.wsPort - }) + const args = {} + + if(this.wsPort){ + args.port = this.wsPort; + }else{ + args.server = this.options.server; + } + + this.wsServer = new ws.Server(args) this.wsServer.on("connection", (socket, request) => { return this.onSocketConnect(socket, request) }) From f72c49b8ca9314935ec2d89a2179329596b15495 Mon Sep 17 00:00:00 2001 From: sasha2018rl Date: Mon, 24 Oct 2022 22:39:32 +0300 Subject: [PATCH 2/2] update repository link --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1bce1fe..66825d6 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/kyriesent/node-rtsp-stream.git" + "url": "git@github.com:Sasha2018RL/node-rtsp-stream.git" }, "author": "David Jsa ", "license": "MIT",