Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
obstipator
Nov 8, 2009

by FactsAreUseless
I'm trying to set up vhosts so I can have local.poopybuttwhole.biz go to one nodejs app and local.bigbootybutts.biz go to a different nodejs app.
The goal is for me to be able to quickly switch between the many apps I have to build with nodejs without having to stop all the various processes used by one app to free up 127.0.0.1 for use on another. The problem is I can't seem to get node to create a listen server on anything other than "127.0.0.1". Trying to get it to listen on "127.0.0.2" or a hostname that dns's to 127.0.0.2 makes it throw a hissy fit about EADDRNOTAVAIL. Is it possible to setup vhosts with node without jumping through hoops? I don't want to have to use a billion different ports because that becomes super tedious. I want to be like, here is my /etc/hosts file with a new 127.* IP, and have it magically have everything else just work with "local.example.com" filled in for the domain in my node code, nginx, etc.

e: nvm, it was a mac thing or something. the various loopbacks need to be setup manually using
sudo ifconfig lo0 alias 127.0.0.2 up

obstipator fucked around with this message at 16:22 on Oct 9, 2015

Adbot
ADBOT LOVES YOU

  • Locked thread