title: Server Sent Events in Cloud Code
body: <p>I'm trying to implement a simple SSE in Cloud Code.</p>
  
  <p>Here's my Express route to open the connection:</p>
  
  <pre><code>app.get('/call', function(req, res) {
  
    // let request last as long as possible
    req.socket.setTimeout(30000);
  
    //send headers for event-stream connection
    res.writeHead(200, {
      'Content-Type': 'text/event-stream',
      'Cache-Control': 'no-cache',
      'Connection': 'keep-alive'
    });
  
    res.write('\n');
  
    // The 'close' event is fired when a user closes their browser window.
    req.on("close", function() {
  
    });
  });
  </code></pre>
  
  <p>I've also made sure to include:</p>
  
  <pre><code>var http = require('http');
  </code></pre>
  
  <p>Problem is, I'm getting this error:</p>
  
  <pre><code>  I2014-06-28T19:09:50.500Z] TypeError: Object function () {
      throw Error('IncomingMessage.socket not supported');
    } has no method 'setTimeout'
      at app.js:129:14
      at callbacks (express_router.js:161:37)
      at param (express_router.js:135:11)
      at pass (express_router.js:142:5)
      at Router._dispatch (express_router.js:170:5)
      at Object.router (express_router.js:33:10)
      at next (connect_proto.js:240:15)
      at Object.handle (app.js:88:7)
      at next (connect_proto.js:240:15)
      at Object.parseExpressCookieSession [as handle] (parse-express-cookie-session.js:315:7)
  </code></pre>
  
  <p>I've also tried just:</p>
  
  <pre><code>req.setTimeout(30000);
  </code></pre>
  
  <p>But get a similar error.</p>
  
  <p>I read something about how <code>setTimeout</code> isn't implement until a later version of node. Could this be the issue? I couldn't find what version of node Parse is running.</p>