How to Proxy a Domain to Localhost

  • STEP 1:

Edit your hosts file by typing:

1
sudo vim /etc/hosts

Add the following line to the file:

1
127.0.0.1 google.com (or whatever other hostname you want proxied)
  • STEP 2:

Type the following into the command line to (ip foward)set up the server port to 80 in this case it is 3000:

1
sudo ipfw add 100 fwd 127.0.0.1,3000 tcp from any to any 80 in

Any questions on this, please feel free to ask. We’re here to help…

Comments

Comments