A web-based drawing app
git clone git://soophie.de/outline
blob: b442844315da2707213f5f7408b56bbf9cde2526 (649 bytes)[doc][blame][raw]
1
const express = require('express');2
const app = express();3
const http = require('http').createServer(app);4
const io = require('socket.io')(http);6
let port = 80;8
app.use(express.static(__dirname + '/public'));10
const proxy = http.listen(port, function() {11
console.log('Server started on port: ' + port);12
});14
io.path('/pipe');15
io.listen(proxy);17
io.on('connection', function(socket) {19
socket.on('data' , function(data) {20
socket.broadcast.emit('data', data);21
});22
socket.on('clear' , function(data) {23
socket.broadcast.emit('clear', data);24
});25
socket.on('background' , function(data) {26
socket.broadcast.emit('background', data);27
});28
});