Index: trip-planner-front/node_modules/ws/lib/websocket-server.js
===================================================================
--- trip-planner-front/node_modules/ws/lib/websocket-server.js	(revision 6a3a178323fd905112b5392bd9d3cb83b66ef2d3)
+++ trip-planner-front/node_modules/ws/lib/websocket-server.js	(revision bdd64917749115bbdd228a9569a675d590c112e3)
@@ -2,11 +2,11 @@
 
 const EventEmitter = require('events');
-const { createHash } = require('crypto');
-const { createServer, STATUS_CODES } = require('http');
+const crypto = require('crypto');
+const http = require('http');
 
 const PerMessageDeflate = require('./permessage-deflate');
+const extension = require('./extension');
 const WebSocket = require('./websocket');
-const { format, parse } = require('./extension');
-const { GUID, kWebSocket } = require('./constants');
+const { GUID } = require('./constants');
 
 const keyRegex = /^[+/0-9A-Za-z]{22}==$/;
@@ -22,38 +22,39 @@
    *
    * @param {Object} options Configuration options
-   * @param {Number} [options.backlog=511] The maximum length of the queue of
-   *     pending connections
-   * @param {Boolean} [options.clientTracking=true] Specifies whether or not to
-   *     track clients
-   * @param {Function} [options.handleProtocols] A hook to handle protocols
-   * @param {String} [options.host] The hostname where to bind the server
-   * @param {Number} [options.maxPayload=104857600] The maximum allowed message
-   *     size
-   * @param {Boolean} [options.noServer=false] Enable no server mode
-   * @param {String} [options.path] Accept only connections matching this path
-   * @param {(Boolean|Object)} [options.perMessageDeflate=false] Enable/disable
+   * @param {Number} options.backlog The maximum length of the queue of pending
+   *     connections
+   * @param {Boolean} options.clientTracking Specifies whether or not to track
+   *     clients
+   * @param {Function} options.handleProtocols An hook to handle protocols
+   * @param {String} options.host The hostname where to bind the server
+   * @param {Number} options.maxPayload The maximum allowed message size
+   * @param {Boolean} options.noServer Enable no server mode
+   * @param {String} options.path Accept only connections matching this path
+   * @param {(Boolean|Object)} options.perMessageDeflate Enable/disable
    *     permessage-deflate
-   * @param {Number} [options.port] The port where to bind the server
-   * @param {http.Server} [options.server] A pre-created HTTP/S server to use
-   * @param {Function} [options.verifyClient] A hook to reject connections
-   * @param {Function} [callback] A listener for the `listening` event
+   * @param {Number} options.port The port where to bind the server
+   * @param {http.Server} options.server A pre-created HTTP/S server to use
+   * @param {Function} options.verifyClient An hook to reject connections
+   * @param {Function} callback A listener for the `listening` event
    */
   constructor(options, callback) {
     super();
 
-    options = {
-      maxPayload: 100 * 1024 * 1024,
-      perMessageDeflate: false,
-      handleProtocols: null,
-      clientTracking: true,
-      verifyClient: null,
-      noServer: false,
-      backlog: null, // use default (511 as implemented in net.js)
-      server: null,
-      host: null,
-      path: null,
-      port: null,
-      ...options
-    };
+    options = Object.assign(
+      {
+        maxPayload: 100 * 1024 * 1024,
+        perMessageDeflate: false,
+        handleProtocols: null,
+        clientTracking: true,
+        verifyClient: null,
+        noServer: false,
+        backlog: null, // use default (511 as implemented in net.js)
+        server: null,
+        host: null,
+        path: null,
+        port: null
+      },
+      options
+    );
 
     if (options.port == null && !options.server && !options.noServer) {
@@ -64,6 +65,6 @@
 
     if (options.port != null) {
-      this._server = createServer((req, res) => {
-        const body = STATUS_CODES[426];
+      this._server = http.createServer((req, res) => {
+        const body = http.STATUS_CODES[426];
 
         res.writeHead(426, {
@@ -84,11 +85,11 @@
 
     if (this._server) {
-      const emitConnection = this.emit.bind(this, 'connection');
-
       this._removeListeners = addListeners(this._server, {
         listening: this.emit.bind(this, 'listening'),
         error: this.emit.bind(this, 'error'),
         upgrade: (req, socket, head) => {
-          this.handleUpgrade(req, socket, head, emitConnection);
+          this.handleUpgrade(req, socket, head, (ws) => {
+            this.emit('connection', ws, req);
+          });
         }
       });
@@ -121,5 +122,5 @@
    * Close the server.
    *
-   * @param {Function} [cb] Callback
+   * @param {Function} cb Callback
    * @public
    */
@@ -208,5 +209,5 @@
 
       try {
-        const offers = parse(req.headers['sec-websocket-extensions']);
+        const offers = extension.parse(req.headers['sec-websocket-extensions']);
 
         if (offers[PerMessageDeflate.extensionName]) {
@@ -226,5 +227,5 @@
         origin:
           req.headers[`${version === 8 ? 'sec-websocket-origin' : 'origin'}`],
-        secure: !!(req.socket.authorized || req.socket.encrypted),
+        secure: !!(req.connection.authorized || req.connection.encrypted),
         req
       };
@@ -256,5 +257,4 @@
    * @param {Buffer} head The first packet of the upgraded stream
    * @param {Function} cb Callback
-   * @throws {Error} If called more than once with the same socket
    * @private
    */
@@ -265,12 +265,6 @@
     if (!socket.readable || !socket.writable) return socket.destroy();
 
-    if (socket[kWebSocket]) {
-      throw new Error(
-        'server.handleUpgrade() was called more than once with the same ' +
-          'socket, possibly due to a misconfiguration'
-      );
-    }
-
-    const digest = createHash('sha1')
+    const digest = crypto
+      .createHash('sha1')
       .update(key + GUID)
       .digest('base64');
@@ -284,5 +278,5 @@
 
     const ws = new WebSocket(null);
-    let protocol = req.headers['sec-websocket-protocol'];
+    var protocol = req.headers['sec-websocket-protocol'];
 
     if (protocol) {
@@ -300,5 +294,5 @@
       if (protocol) {
         headers.push(`Sec-WebSocket-Protocol: ${protocol}`);
-        ws._protocol = protocol;
+        ws.protocol = protocol;
       }
     }
@@ -306,5 +300,5 @@
     if (extensions[PerMessageDeflate.extensionName]) {
       const params = extensions[PerMessageDeflate.extensionName].params;
-      const value = format({
+      const value = extension.format({
         [PerMessageDeflate.extensionName]: [params]
       });
@@ -328,5 +322,5 @@
     }
 
-    cb(ws, req);
+    cb(ws);
   }
 }
@@ -340,6 +334,5 @@
  * @param {EventEmitter} server The event emitter
  * @param {Object.<String, Function>} map The listeners to add
- * @return {Function} A function that will remove the added listeners when
- *     called
+ * @return {Function} A function that will remove the added listeners when called
  * @private
  */
@@ -384,14 +377,16 @@
 function abortHandshake(socket, code, message, headers) {
   if (socket.writable) {
-    message = message || STATUS_CODES[code];
-    headers = {
-      Connection: 'close',
-      'Content-Type': 'text/html',
-      'Content-Length': Buffer.byteLength(message),
-      ...headers
-    };
+    message = message || http.STATUS_CODES[code];
+    headers = Object.assign(
+      {
+        Connection: 'close',
+        'Content-type': 'text/html',
+        'Content-Length': Buffer.byteLength(message)
+      },
+      headers
+    );
 
     socket.write(
-      `HTTP/1.1 ${code} ${STATUS_CODES[code]}\r\n` +
+      `HTTP/1.1 ${code} ${http.STATUS_CODES[code]}\r\n` +
         Object.keys(headers)
           .map((h) => `${h}: ${headers[h]}`)
