I am running an express app on node.js. The app uses the express-subdomain module to help handle routes for two different subdomains (sub1.example.com and sub2.example.com). I\'
I had same exact problem and I found a simple solution. Instead of writing sub1.localhost try replacing localhost with lvh.me this is a domain that always resolves to localhost and now whenever you write sub1.lvh.me even though a port like sub1.lvh.me:3000 it will still work.