title: Setting up multiple HTTPS servers listening on the same port in Node
body: <p>By not specifying a protocol, the following block will result in an HTTPS server that uses TLS 1.2:</p>
  
  <pre><code>var options = {
      key: fs.readFileSync("security/server.key"),
      cert: fs.readFileSync("security/server.crt")
  };
  https.createServer(options, app).listen(443);
  </code></pre>
  
  <p>However, one of my endpoints needs to act as a subscriber endpoint for the Fitbit API, which requires TLS 1.0. To do this, I need to set <code>secureProtocol</code> to <code>TLSv1_method</code>.</p>
  
  <pre><code>var options = {
      key: fs.readFileSync("security/server.key"),
      cert: fs.readFileSync("security/server.crt"),
      secureProtocol: "TLSv1_method" // Fitbit subscription API requires TLS 1.0
  };
  https.createServer(options, app).listen(443);
  </code></pre>
  
  <p>What would be the best way to use TLS 1.0 for one endpoint and TLS 1.2 for all others? The answer may lie in the <a href="https://github.com/nodejitsu/node-http-proxy" rel="nofollow">http-proxy</a> module, but I'm having a hard time applying the documentation to my use case. Note that I am using different subdomains to differentiate the traffic.</p>