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
1 var Gun = require('gun'); 1 var Gun = require('gun');
2 var server = require('http').createServer().listen(3000);
3 var gun1 = Gun({web: server, path: '/gun1'});
4 var gun2 = Gun({web: server, path: '/gun2'});
...\ No newline at end of file ...\ No newline at end of file
2 var http = require('http');
3 var server = http.createServer().listen(300);
4 var wss_event = new WebSocket.Server({
5 noServer: true
6 });
7 server.on('upgrade', function (request, socket, head) {
8 var pathname = url.parse(request.url).pathname;
9 if (pathname === '/sim_world') {
10 wss_event.handleUpgrade(request, socket, head, function (ws) {
11 wss_event.emit('connection', ws);
12 });
13 } else {
14 socket.destroy();
15 }
16 });
...\ No newline at end of file ...\ 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!