I'm trying to debug program that uses many ports (other than 80, 443) for retrieving data, and i want to create "redirector" that redirect all connections from (for example: example.com) to localhost.
Is that possible without directly hacking program? How to do that?
If the program is running on your local machine, you could modify /etc/hosts and add the following line:
example.com 127.0.0.1
This will route all connections from your machine to example.com to localhost (127.0.0.1).