Quantcast
Channel: Active questions tagged https - Stack Overflow
Viewing all articles
Browse latest Browse all 1854

Serve two https hostnames from single node process & port

$
0
0

Is there a way to serve two https sites on the same port from node alone (i.e. without something like nginx)?

I'm using the https module, for which SSL options (e.g. key/cert/ca) are passed into createServer. I tried creating two https servers, each listening to a different hostname, and each with SSL options specific to that hostname:

require('https').createServer(sslOptsForFoo, expressApp).listen(443, 'foo.com');require('https').createServer(sslOptsForBar, expressApp).listen(443, 'bar.com');

But this throws an error:

Error: listen EADDRINUSE

Another idea is to create a single server rather than two, and to use different SSL options depending on the request's hostname, but I'm not sure if this is possible.


Viewing all articles
Browse latest Browse all 1854

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>