How do you create a reverse proxy on Mac to redirect specific domains to another port on localhost?

For example, this is what I'm trying to do.

In /etc/hosts:

127.0.0.1 www.example.com

Which should point to a reverse proxy:

127.0.0.1:80 

Which should point to:

127.0.0.1:8080

So essentially:

www.example.com -> 127.0.0.1:8080
www.test.com -> 127.0.0.1:8081
link|improve this question
feedback

migrated from stackoverflow.com Jun 22 '11 at 20:07

This question came from our site for professional and enthusiast programmers.

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.