summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--example/express-app.js3
-rw-r--r--mjpeg-proxy.js3
2 files changed, 4 insertions, 2 deletions
diff --git a/example/express-app.js b/example/express-app.js
index 558708d..be2b7de 100644
--- a/example/express-app.js
+++ b/example/express-app.js
@@ -22,6 +22,7 @@
var MjpegProxy = require('../mjpeg-proxy').MjpegProxy;
var express = require('express');
var app = express();
+
var HTTP_PORT = 8080;
var cam1 = "http://admin:admin@192.168.124.54/cgi/mjpg/mjpg.cgi";
@@ -35,4 +36,4 @@ app.get('/index2.jpg', new MjpegProxy(cam2).proxyRequest);
app.listen(HTTP_PORT);
-console.log("Listening on port "+HTTP_PORT);
+console.log("Listening on port " + HTTP_PORT); \ No newline at end of file
diff --git a/mjpeg-proxy.js b/mjpeg-proxy.js
index e7989d4..0802497 100644
--- a/mjpeg-proxy.js
+++ b/mjpeg-proxy.js
@@ -57,6 +57,7 @@ var MjpegProxy = exports.MjpegProxy = function(mjpegUrl) {
} else {
// Send source MJPEG request
var mjpegRequest = http.request(self.mjpegOptions, function(mjpegResponse) {
+ // console.log('request');
self.globalMjpegResponse = mjpegResponse;
self.boundary = extractBoundary(mjpegResponse.headers['content-type']);
@@ -126,7 +127,7 @@ var MjpegProxy = exports.MjpegProxy = function(mjpegUrl) {
self.audienceResponses.push(res);
self.newAudienceResponses.push(res);
- res.socket.on('close', function () {
+ req.socket.on('close', function () {
// console.log('exiting client!');
self.audienceResponses.splice(self.audienceResponses.indexOf(res), 1);