command line arguments support added, webrtc config improved for p2p
This commit is contained in:
@@ -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/');
|
||||
}
|
||||
|
||||
@@ -15,5 +15,6 @@
|
||||
"HttpsPort": 443,
|
||||
"StreamerPort": 8888,
|
||||
"SFUPort": 8889,
|
||||
"MaxPlayerCount": -1
|
||||
"MaxPlayerCount": -1,
|
||||
"peerConnectionOptions": "{ \"iceServers\": [{\"urls\": [\"stun:stun1.l.google.com:19302\",\"stun:stun1.l.google.com:19302\"]}] }"
|
||||
}
|
||||
Reference in New Issue
Block a user