diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7c76ecd --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Ignore these things # +####################### +node_modules \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..3a38ee2 --- /dev/null +++ b/package.json @@ -0,0 +1,8 @@ +{ + "name": "switchist" + , "version": "0.0.1" + , "private": true + , "dependencies": { + "socket.io": "" + } +} \ No newline at end of file diff --git a/remote.html b/remote.html new file mode 100644 index 0000000..d14437d --- /dev/null +++ b/remote.html @@ -0,0 +1,90 @@ + + + + + Switcher: Remote + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+ +
+ + +
+
+

Instructions

+

Enter the URL to change the display to.

+
+
+
+
+
+ +
+ + +
+
+
+
+
+
+ + + +
+ + + + diff --git a/switcher_app.js b/switcher_app.js new file mode 100644 index 0000000..92bed7f --- /dev/null +++ b/switcher_app.js @@ -0,0 +1,25 @@ +var app = require('http').createServer(handler) + , io = require('socket.io').listen(app) + , fs = require('fs') + +app.listen(3030); + +function handler (req, res) { + fs.readFile(__dirname + '/index.html', + function (err, data) { + if (err) { + res.writeHead(500); + return res.end('Error loading index.html'); + } + + res.writeHead(200); + res.end(data); + }); +} + +io.sockets.on('connection', function (socket) { + socket.on('change location', function (data) { + console.log('got changelocation'); + socket.emit('window location', data); + }); +}); \ No newline at end of file