title: Ports in herokuapp
body: <p>So, I recently deployed a PeerJS app to heroku. I created an instance of a PeerJSserver like this: (as mentioned on their github page)</p>
  
  <pre><code>// determining the port
  var port = Number(process.env.PORT || '3000');
  
  var server = app.listen(port, function() {
      console.log('Server is running on port ' + port);
  });
  
  // peerjs server setup
  var peerServer = ExpressPeerServer(server);
  app.use('/app', peerServer);
  peerServer.on('connection', function(id) { console.log(id); });
  </code></pre>
  
  <p>and on the client side, I wanna connect to this server, like this:</p>
  
  <pre><code>&lt;script&gt;
      var peer = new Peer('someid', {host: '/', port: 9000, path: '/app'});
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>The Problem:</strong><br>
  So, you already know that heroku randomly decides a port on which the app should be running. If I check my logs, I can see the port on which the server is running. So, how can I determine the port on the client side? I've tried not giving the object constructor a port and it automatically gives it a port of <strong>9000</strong> (which i think is the default).</p>
  
  <p>So, should I query the server to determine its port? Or is there a better alternative?</p>