Click to See Complete Forum and Search --> : bind() / Winsock problems


Renzo
January 23rd, 2004, 04:43 AM
Well anyhow, i making this program to act as a proxy between this client and its server.

The first bit it does is via hostname, it contacts the server list server and finds out what the IP is of the server.. Now i can 'proxy' that bit (aka it sends to my program and my program sends to real server etc...) by editing the hosts file with 127.0.0.1 serv.example.com.......

But after that it connects directly to the IP, so the hosts file bit doesnt have any effect after that.....

How can i make it send to my program? Some sort of hook?

I tryed Bind() bit it returns error 10049 which is something about an IP address not associated with the local PC.

So anyone got any ideas what to do?

j0nas
January 23rd, 2004, 05:31 AM
As I see it, you have two options:
1. The easy one: implement socks v4 or v5 support in your proxy. If the client program has socks support, this is by far the easiest to do.
2. The harder one: implement a layered service provider DLL (LSP DLL). With that, you can "hook" winsock2 calls.

Renzo
January 23rd, 2004, 05:35 AM
No other options?



Im reasonably positive it can be done another way :s

j0nas
January 23rd, 2004, 05:44 AM
No, please tell me if you find out some other way (there are of course even more harder ways, like implementing a device driver).