-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathrtmpServer.js
More file actions
28 lines (26 loc) · 800 Bytes
/
rtmpServer.js
File metadata and controls
28 lines (26 loc) · 800 Bytes
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
28
/**
* Created by delian on 3/11/14.
*
* Simple implmenetation of an RTMP Server
*
*/
var net = require('net');
var Log = require('./log.js');
var rtmpSession = require('./rtmpSession.js');
var debug = 0;
module.exports = function() {
Log(debug).log('Create RTMP Server Object');
var ret = {};
ret.createServer = function(cb) {
Log(debug).log('Create RTMP Server');
return net.createServer(function(sock) {
sock.setMaxListeners(100); // Warning related to the amount of CS id's
rtmpSession(sock,0,function() {
Log(debug).log('Callback the Server callback!');
var me = this;
cb.apply(me,arguments); // Call the CallBack preserving the object
});
});
};
return ret;
};