forked from bigbluebutton/bbb-webrtc-sfu
-
Notifications
You must be signed in to change notification settings - Fork 4
/
server.js
executable file
·27 lines (22 loc) · 877 Bytes
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
'use strict';
const config = require('config');
const WebsocketConnectionManager = require('./lib/main/ws-connection-manager.js');
const ConnectionManager = require('./lib/main/connection-manager.js');
const SFUModuleManager = require('./lib/main/sfu-module-manager.js');
const Janitor = require('./lib/main/janitor.js');
const HTTP_SERVER_HOST = config.has('clientHost') ? config.get('clientHost') : '127.0.0.1';
const HTTP_SERVER_PORT = config.get('clientPort');
const WS_SERVER_OPTIONS = config.has('wsServerOptions')
? config.get('wsServerOptions')
: { maxPayload: 51200 };
const WSManager = new WebsocketConnectionManager(
HTTP_SERVER_HOST,
HTTP_SERVER_PORT,
'/bbb-webrtc-sfu',
WS_SERVER_OPTIONS
);
const CM = new ConnectionManager();
SFUModuleManager.start();
CM.setupModuleRouting(SFUModuleManager.modules);
CM.addAdapter(WSManager);
Janitor.clockIn();