ソースを参照

Only accept width/height params if the STREAM_SECRET matches

phoboslab 11 年 前
コミット
f59de44b72
共有1 個のファイルを変更した3 個の追加2 個の削除を含む
  1. 3 2
      stream-server.js

+ 3 - 2
stream-server.js ファイルの表示

@@ -48,10 +48,11 @@ socketServer.broadcast = function(data, opts) {
48 48
 // HTTP Server to accept incomming MPEG Stream
49 49
 var streamServer = require('http').createServer( function(request, response) {
50 50
 	var params = request.url.substr(1).split('/');
51
-	width = (params[1] || 320)|0;
52
-	height = (params[2] || 240)|0;
53 51
 
54 52
 	if( params[0] == STREAM_SECRET ) {
53
+		width = (params[1] || 320)|0;
54
+		height = (params[2] || 240)|0;
55
+		
55 56
 		console.log(
56 57
 			'Stream Connected: ' + request.socket.remoteAddress + 
57 58
 			':' + request.socket.remotePort + ' size: ' + width + 'x' + height