command line arguments support added, webrtc config improved for p2p

This commit is contained in:
C
2023-02-01 17:08:19 +05:00
parent 236967e7d2
commit 83501d8ab6
2 changed files with 19 additions and 1 deletions
+17
View File
@@ -1,6 +1,19 @@
// Copyright Epic Games, Inc. All Rights Reserved.
//-- Server side logic. Serves pixel streaming WebRTC-based page, proxies data back to Streamer --//
var server_settings = process.argv.slice(2)
if (!server_settings) {
process.exit(1)
}
try {
server_settings = JSON.parse(server_settings)
} catch (err) {
console.log('can not process arguments')
process.exit(1)
}
var express = require('express');
var app = express();
@@ -39,6 +52,10 @@ var configFile = (typeof argv.configFile != 'undefined') ? argv.configFile.toStr
console.log(`configFile ${configFile}`);
const config = require('./modules/config.js').init(configFile, defaultConfig);
config.StreamerPort = server_settings.app_port
config.HttpPort = server_settings.webrtc_port
config.SFUPort = 0
if (config.LogToFile) {
logging.RegisterFileLogger('./logs/');
}