diff options
| author | Jibon Costa <jiboncosta57@gmail.com> | 2020-03-29 22:00:01 +0600 |
|---|---|---|
| committer | Jibon Costa <jiboncosta57@gmail.com> | 2020-03-29 22:00:01 +0600 |
| commit | 753e98125ba93504c72effa6a74e92851a48787b (patch) | |
| tree | a7056c357c6cd702bef538f4fdc8efdb935c835f /ffmpegServer.js | |
| parent | 55850d77277a336523530b8c14692faa275c8544 (diff) | |
| download | bbb-recorder-753e98125ba93504c72effa6a74e92851a48787b.tar.gz bbb-recorder-753e98125ba93504c72effa6a74e92851a48787b.zip | |
separate config file added
Diffstat (limited to 'ffmpegServer.js')
| -rw-r--r-- | ffmpegServer.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ffmpegServer.js b/ffmpegServer.js index da3d1ba..ef8c3a6 100644 --- a/ffmpegServer.js +++ b/ffmpegServer.js @@ -1,8 +1,11 @@ const child_process = require('child_process'); const WebSocketServer = require('ws').Server; const http = require('http'); +const fs = require('fs'); -const server = http.createServer().listen(4000, () => { +var config = JSON.parse(fs.readFileSync("config.json", 'utf8')); + +const server = http.createServer().listen(config.ffmpegServerPort, () => { console.log('Listening...'); }); @@ -11,7 +14,7 @@ const wss = new WebSocketServer({ }); -const rtmpUrl = "rtmp://a.rtmp.youtube.com/live2/MyKey"; +const rtmpUrl = config.rtmpUrl; wss.on('connection', function connection(ws, req) { console.log('connection'); @@ -23,7 +26,7 @@ wss.on('connection', function connection(ws, req) { return; } - if(auth[1] !== "mZFZN4yc"){ + if(auth[1] !== config.auth){ ws.terminate(); return; } |
