From 91736294567db46f2f309f53c42f287622e21591 Mon Sep 17 00:00:00 2001 From: Georges-Etienne Legendre Date: Mon, 4 Feb 2013 13:39:06 -0500 Subject: A module version of this application, with express.js --- example/express-app.js | 19 +++++++++++++++++++ example/public/index.html | 13 +++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 example/express-app.js create mode 100644 example/public/index.html (limited to 'example') diff --git a/example/express-app.js b/example/express-app.js new file mode 100644 index 0000000..9342f66 --- /dev/null +++ b/example/express-app.js @@ -0,0 +1,19 @@ +var express = require('express'); +var MjpegProxy = require('../mjpeg-proxy').MjpegProxy; + +var cam1 = "http://admin:admin@192.168.124.54/cgi/mjpg/mjpg.cgi"; +var cam2 = "http://admin:@192.168.124.32/videostream.cgi"; + +var app = express(); + +app.set("view options", {layout: false}); +app.use(express.static(__dirname + '/public')); + +app.get('/', function(req, res) { + res.render('index.html'); +}); + +app.get('/index1.jpg', new MjpegProxy(cam1).proxyRequest); +app.get('/index2.jpg', new MjpegProxy(cam2).proxyRequest); + +app.listen(8080) \ No newline at end of file diff --git a/example/public/index.html b/example/public/index.html new file mode 100644 index 0000000..c7d3e9d --- /dev/null +++ b/example/public/index.html @@ -0,0 +1,13 @@ + + + + + Node MJPEG Proxy Example + + + + + + + + -- cgit v1.2.1