-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In-between commit for application support
- Loading branch information
Showing
21 changed files
with
350 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Handshake fertig. | ||
Client: INVOKE [ 'connect', 1, { | ||
app: 'flvplayback', flashVer: 'MAC 10,2,159,1', swfUrl: undefined, | ||
tcUrl: 'rtmp://muse/flvplayback', fpad: false, capabilities: 239, | ||
audioCodecs: 3191, videoCodecs: 252, videoFunction: 1, | ||
pageUrl: undefined, objectEncoding: 3 } ] | ||
Client: SERVER (windowSize = 0x2625a0) | ||
Server: SERVER (windowSize = idem) | ||
Server: BANDWIDTH (windowSize = idem, limit = 2) | ||
Server: INVOKE [ '_result', 1, { fmsVer: 'FMS/3,0,1,123', capabilities: 31 }, | ||
{ level: 'status', code: 'NetConnection.Connect.Success', | ||
description: 'Connection succeeded', objectEncoding: 3 } ] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
"use strict"; | ||
|
||
var net = require('net'); | ||
var mtrude = require('mtrude'); | ||
var rtmp = mtrude.rtmp; | ||
var ChunkStream = rtmp.ChunkStream; | ||
var MessageStream = rtmp.MessageStream; | ||
var Application = rtmp.Application; | ||
var utils = mtrude.utils; | ||
|
||
|
||
function workWithChunkStream(chunkStream) { | ||
var messageStream = new MessageStream(chunkStream); | ||
var application = new Application(messageStream, { | ||
connect: function(command) { | ||
console.log('NetConnection.connect(): ', command[2]); | ||
return true; | ||
}, | ||
}); | ||
} | ||
|
||
function main() { | ||
var optimist = require('optimist') | ||
.usage('Usage: $0 [--debug] [in [out]]') | ||
.boolean('debug') | ||
.boolean('help') | ||
.alias('h', 'help') | ||
.describe('debug', 'Set MessageStream.DBG = true') | ||
.describe('nocolor', 'Don\'t use colors') | ||
; | ||
var argv = optimist.argv; | ||
|
||
if (argv.help || argv._.length > 2) { | ||
optimist.showHelp(); | ||
return; | ||
} | ||
|
||
if (argv.debug) MessageStream.DBG = true; | ||
|
||
if (argv._.length == 0) { | ||
var server = net.createServer(); | ||
server.on('connection', function(socket) { | ||
console.log('CONN : ' + 'Connection from %s', socket.remoteAddress); | ||
workWithChunkStream(new ChunkStream(socket)); | ||
}); | ||
server.listen(1935); | ||
console.log('LISTN: Listening on port 1935'); | ||
} | ||
else { | ||
var iFile = argv._[0]; | ||
var time36 = new Date().getTime().toString(36) | ||
var oFile = argv._[1] || 'out-' + time36 + '.raw'; | ||
var chunkStream = new ChunkStream(utils.asSocket(iFile, oFile | ||
, function() { console.log('FILE : ' + 'Reading %s', iFile); } | ||
, function() { console.log('FILE : ' + 'Writing %s', oFile); } | ||
)); | ||
|
||
workWithChunkSteram(chunkStream); | ||
} | ||
} | ||
|
||
if (require.main === module) main(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
exports.BufferChain = require('./BufferChain'); | ||
exports.OutgoingTools = require('./OutgoingTools'); | ||
exports.asSocket = require('./asSocket'); | ||
exports.utils = require('./utils'); | ||
exports.rtmp = require('./rtmp/RTMP'); | ||
exports.rtmp.ChunkStream = require('./rtmp/ChunkStream'); | ||
exports.rtmp.MessageStream = require('./rtmp/MessageStream'); | ||
exports.rtmp.Application = require('./rtmp/Application'); | ||
exports.rtmp.AMF = require('./rtmp/AMF'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.