4cd6a320 by Glitch (hello-express)

:kiss_mm::sweet_potato: Checkpoint

./server.js:13690106/1091
1 parent f0b3bec7
Showing 1 changed file with 15 additions and 3 deletions
var Gun = require('gun');
var server = require('http').createServer().listen(3000);
var gun1 = Gun({web: server, path: '/gun1'});
var gun2 = Gun({web: server, path: '/gun2'});
\ No newline at end of file
var http = require('http');
var server = http.createServer().listen(300);
var wss_event = new WebSocket.Server({
noServer: true
});
server.on('upgrade', function (request, socket, head) {
var pathname = url.parse(request.url).pathname;
if (pathname === '/sim_world') {
wss_event.handleUpgrade(request, socket, head, function (ws) {
wss_event.emit('connection', ws);
});
} else {
socket.destroy();
}
});
\ No newline at end of file
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!