title: Binding HTTP and HTTPS traffic on the SAME port in node.js?
body: <p>I have a scenario where my node.js app is behind a Load Balancing HAProxy, which is forwarding both HTTP and HTTPS traffic to port 8000 on my node servers.</p>
  
  <p>Unfortunately this puts me in a tricky spot: I need to use the SAME port for my http and https servers. I would also be satisfied merely redirecting http to https, if that is easier in some way.</p>
  
  <p>But, right now, I am in a position where I am forced to choose HTTP --OR-- HTTPS</p>
  
  <p>For the sake of including code...</p>
  
  <pre><code>https.createServer(api.credentials, api.server).listen(8000);
  http.createServer(api.server).listen(8000); // ERR ADDR IN USE
  </code></pre>