From 07c2355604ad52103ff95d481252c1ef8086241e Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Thu, 7 Apr 2016 10:24:44 +0200 Subject: support for standalone multiplexing --- plugin/multiplex/index.js | 10 +++++++++- plugin/multiplex/package.json | 19 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 plugin/multiplex/package.json (limited to 'plugin') diff --git a/plugin/multiplex/index.js b/plugin/multiplex/index.js index 40c1661..8195f04 100644 --- a/plugin/multiplex/index.js +++ b/plugin/multiplex/index.js @@ -31,7 +31,15 @@ io.on( 'connection', function( socket ) { app.get("/", function(req, res) { res.writeHead(200, {'Content-Type': 'text/html'}); - fs.createReadStream(opts.baseDir + '/index.html').pipe(res); + + var stream = fs.createReadStream(opts.baseDir + '/index.html'); + stream.on('error', function( error ) { + res.write('