title: Can I set up socket.io chat on heroku?
body: <p>I have a simple socket.io chat application which I've uploaded to one of the new <a href="http://devcenter.heroku.com/articles/cedar" rel="noreferrer">Heroku 'cedar'</a> stacks.</p>
  
  <p>Now I almost have everything working but I've hit one stumbling block. On my localhost, I open a connection to the socket server from the client with:</p>
  
  <pre><code>// lots of HTML omitted
  socket = new io.Socket('localhost', {port: 8888});
  </code></pre>
  
  <p>But on Heroku, I obviously must substitute something else in for these values.</p>
  
  <p>I can get the port from the process object on the server like so:</p>
  
  <pre><code>port = process.env.PORT || 8888
  </code></pre>
  
  <p>and pass that to the view.</p>
  
  <p>But what do I substitute for <code>'localhost'</code>?</p>