Преглед на файлове

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