Your application can already process requests for multiple hosts.
Since you did not specify hostname :
[...] the server will accept connections directed to any IPv4 address ( INADDR_ANY ).
And you can determine which host was used for the request from headers :
var host = req.headers.host;
However, you will also need to configure the IP address for subdomains in DNS or hosts .
Or using services like xip.io - using the IP address, not localhost :
http://127.0.0.1.xip.io:9876/ http://foo.127.0.0.1.xip.io:9876/ http://anything.127.0.0.1.xip.io:9876/
source share