title: node.js + express error: cannot read property 'url' of undefined
body: <p>I'm fairly new to Node.js, installing it to try out the DrupalChat (v7dev) module. I believe this problem is with either node.js or express, as I am beyond the stage where the chat module's settings are loaded. I am faced with the following output when trying to start the chat server</p>
  
  <pre><code>Extension loaded: drupalchat_nodejs.server.extension.js
  Started http server.
     info  - socket.io started
  
  node.js:201
          throw e; // process.nextTick error, or 'error' event on first tick
                ^
  TypeError: Cannot read property 'url' of undefined
      at Function.handle (/usr/local/lib/node_modules/npm/node_modules/express/node_modules/connect/lib/proto.js:105:18)
      at Server.app (/usr/local/lib/node_modules/npm/node_modules/express/node_modules/connect/lib/connect.js:60:31)
      at Server.serverListening (/usr/local/lib/node_modules/npm/node_modules/socket.io/node_modules/policyfile/lib/server.js:136:16)
      at Server.g (events.js:154:14)
      at Server.emit (events.js:64:17)
      at Array.1 (net.js:710:10)
      at EventEmitter._tickCallback (node.js:192:40)
  </code></pre>
  
  <p>I remember when express installed, it gave a warning like ".... bugs['web'] should probably be bugs['url']"  (I can't remember the prefix)</p>
  
  <p>So is it that the server is trying to read an (API?) variable 'url' but its currently 'web'?</p>
  
  <p>I have all the modules up to date, is it that I should downgrade? Or is there some way of working around this using another module?</p>
  
  <p>EDIT:
  line 201 is the last very line (delete authenticatedClients[authData.authToken];)... I just added to whole function for proper context</p>
  
  <pre><code>var authenticateClientCallback = function (error, response, body) {
    if (error) {
      console.log("Error with authenticate client request:", error);
      return;
    }
    if (response.statusCode == 404) {
      if (settings.debug) {
        console.log('Backend authentication url not found, full response info:', response);
      }
      else {
        console.log('Backend authentication url not found.');
      }
      return;
    }
  
    var authData = false;
    try {
      authData = JSON.parse(body);
    }
    catch (exception) {
      console.log('Failed to parse authentication message:', exception);
      if (settings.debug) {
        console.log('Failed message string: ' + body);
      }
      return;
    }
    if (!checkServiceKey(authData.serviceKey)) {
      console.log('Invalid service key "', authData.serviceKey, '"');
      return;
    }
    if (authData.nodejsValidAuthToken) {
      if (settings.debug) {
        console.log('Valid login for uid "', authData.uid, '"');
      }
      setupClientConnection(authData.clientId, authData, authData.contentTokens);
      authenticatedClients[authData.authToken] = authData;
    }
    else {
      console.log('Invalid login for uid "', authData.uid, '"');
      delete authenticatedClients[authData.authToken];
    }
  }
  </code></pre>