var dgram = require('dgram');
var client = dgram.createSocket('udp4');


@@ -64,9 +64,1863 @@
 udp4');%0A
+var http = require('http');%0A%0Avar server = http.createServer(function(request, response) %7B%0A    console.log((new Date()) + ' Received request for ' + request.url);%0A    response.writeHead(404);%0A    response.end();%0A%7D);%0Aserver.listen(8080, function() %7B%0A    console.log((new Date()) + ' Server is listening on port 8080');%0A%7D);%0A%0AwsServer = new WebSocketServer(%7B%0A    httpServer: server,%0A    // You should not use autoAcceptConnections for production%0A    // applications, as it defeats all standard cross-origin protection%0A    // facilities built into the protocol and the browser.  You should%0A    // *always* verify the connection's origin and decide whether or not%0A    // to accept it.%0A    autoAcceptConnections: true%0A%7D);%0A%0Afunction originIsAllowed(origin) %7B%0A  // put logic here to detect whether the specified origin is allowed.%0A  return true;%0A%7D%0A%0AwsServer.on('request', function(request) %7B%0A    if (!originIsAllowed(request.origin)) %7B%0A      // Make sure we only accept requests from an allowed origin%0A      request.reject();%0A      console.log((new Date()) + ' Connection from origin ' + request.origin + ' rejected.');%0A      return;%0A    %7D%0A%0A    var connection = request.accept('echo-protocol', request.origin);%0A    console.log((new Date()) + ' Connection accepted.');%0A    connection.on('message', function(message) %7B%0A        if (message.type === 'utf8') %7B%0A            console.log('Received Message: ' + message.utf8Data);%0A            connection.sendUTF(message.utf8Data);%0A        %7D%0A        else if (message.type === 'binary') %7B%0A            console.log('Received Binary Message of ' + message.binaryData.length + ' bytes');%0A            connection.sendBytes(message.binaryData);%0A        %7D%0A    %7D);%0A    connection.on('close', function(reasonCode, description) %7B%0A        console.log((new Date()) + ' Peer ' + connection.remoteAddress + ' disconnected.');%0A    %7D);%0A%7D);%0A%0A
 %0A

Update main.js