2017-10-13 21:50:17 +08:00
|
|
|
const ScreenshareManager = require('./ScreenshareManager');
|
2018-01-26 12:33:40 +08:00
|
|
|
const Logger = require('../utils/Logger');
|
|
|
|
const config = require('config');
|
|
|
|
|
|
|
|
if (config.get('acceptSelfSignedCertificate')) {
|
|
|
|
process.env.NODE_TLS_REJECT_UNAUTHORIZED=0;
|
|
|
|
}
|
2017-10-13 21:50:17 +08:00
|
|
|
|
2017-11-25 02:59:40 +08:00
|
|
|
let c = new ScreenshareManager();
|
|
|
|
|
2018-01-26 12:33:40 +08:00
|
|
|
process.on('uncaughtException', (error) => {
|
|
|
|
Logger.error('[ScreenshareProcess] Uncaught exception ', error.stack);
|
2017-10-13 21:50:17 +08:00
|
|
|
});
|
|
|
|
|
2017-11-25 02:59:40 +08:00
|
|
|
process.on('disconnect', c.stopAll);
|
2018-01-26 12:33:40 +08:00
|
|
|
|
|
|
|
// Added this listener to identify unhandled promises, but we should start making
|
|
|
|
// sense of those as we find them
|
|
|
|
process.on('unhandledRejection', (reason, p) => {
|
|
|
|
Logger.error('[ScreenshareProcess] Unhandled Rejection at: Promise', p, 'reason:', reason);
|
|
|
|
});
|
|
|
|
|
|
|
|
c.start();
|