8a023531 by Glitch (hello-express)

:cop::grapes: Checkpoint

./server.js:13690106/274
1 parent 4cd6a320
Showing 1 changed file with 13 additions and 7 deletions
var Gun = require('gun');
var http = require('http');
var server = http.createServer().listen(300);
var wss_event = new WebSocket.Server({
noServer: true
});
const url = require('url');
const Gun = require('gun');
const http = require('http');
const WebSocket = require('ws');
var server = http.createServer().listen(3000);
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') {
if (pathname === '/gun1') {
wss_event.handleUpgrade(request, socket, head, function (ws) {
wss_event.emit('connection', ws);
});
} else if (pathname === '/gun2') {
wss_event.handleUpgrade(request, socket, head, function (ws) {
wss_event.emit('connection', ws);
});
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!