From 4645073ed73d977c19aaa02a335420b10571c7d5 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sun, 21 Jun 2020 13:29:32 +0200 Subject: Well, I don't need a thesis in corona-times --- presentation/plugin/multiplex/client.js | 13 ------ presentation/plugin/multiplex/index.js | 64 ------------------------------ presentation/plugin/multiplex/master.js | 34 ---------------- presentation/plugin/multiplex/package.json | 19 --------- 4 files changed, 130 deletions(-) delete mode 100644 presentation/plugin/multiplex/client.js delete mode 100644 presentation/plugin/multiplex/index.js delete mode 100644 presentation/plugin/multiplex/master.js delete mode 100644 presentation/plugin/multiplex/package.json (limited to 'presentation/plugin/multiplex') diff --git a/presentation/plugin/multiplex/client.js b/presentation/plugin/multiplex/client.js deleted file mode 100644 index 3ffd1e0..0000000 --- a/presentation/plugin/multiplex/client.js +++ /dev/null @@ -1,13 +0,0 @@ -(function() { - var multiplex = Reveal.getConfig().multiplex; - var socketId = multiplex.id; - var socket = io.connect(multiplex.url); - - socket.on(multiplex.id, function(data) { - // ignore data from sockets that aren't ours - if (data.socketId !== socketId) { return; } - if( window.location.host === 'localhost:1947' ) return; - - Reveal.setState(data.state); - }); -}()); diff --git a/presentation/plugin/multiplex/index.js b/presentation/plugin/multiplex/index.js deleted file mode 100644 index 8195f04..0000000 --- a/presentation/plugin/multiplex/index.js +++ /dev/null @@ -1,64 +0,0 @@ -var http = require('http'); -var express = require('express'); -var fs = require('fs'); -var io = require('socket.io'); -var crypto = require('crypto'); - -var app = express(); -var staticDir = express.static; -var server = http.createServer(app); - -io = io(server); - -var opts = { - port: process.env.PORT || 1948, - baseDir : __dirname + '/../../' -}; - -io.on( 'connection', function( socket ) { - socket.on('multiplex-statechanged', function(data) { - if (typeof data.secret == 'undefined' || data.secret == null || data.secret === '') return; - if (createHash(data.secret) === data.socketId) { - data.secret = null; - socket.broadcast.emit(data.socketId, data); - }; - }); -}); - -[ 'css', 'js', 'plugin', 'lib' ].forEach(function(dir) { - app.use('/' + dir, staticDir(opts.baseDir + dir)); -}); - -app.get("/", function(req, res) { - res.writeHead(200, {'Content-Type': 'text/html'}); - - var stream = fs.createReadStream(opts.baseDir + '/index.html'); - stream.on('error', function( error ) { - res.write('