1

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?

Marek Grzyb
  • 177
  • 13

2 Answers2

1

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).

Mario Varchmin
  • 3,704
  • 4
  • 18
  • 33
0

One way is to edit your hosts file on linux/os x /etc/hosts and point all the IP's that your app accesses to localhost.

First though, you're gonna have to figure out what servers your app is accessing. You can do this with a tool like littlesnitch (osx) or even wireshark - though, wireshark method is a bit more involved.

rimraf
  • 3,925
  • 3
  • 25
  • 55