Quote Originally Posted by Schmidt View Post
Well, if it really would be as DEAD SIMPLE as you say, then you should not have a problem, to write one yourself I'd think... ;-)

Ok, more seriously ...

I think your main-problem is in managing all the incoming client-connections from the browser (in dedicated, separate Winsock-Instances! ... just two Instances for Incoming and Outgoing connections are definitely not enough).
And each new created Winsock-Instance for a new, incoming connection (which just got "accepted" from the Listener-SocketInstance) - this Incoming-Connection needs to be properly "linked" (or "associated")
with another separate Winsock-Instance for the Outgoing-Connection.

So there needs to be a management (creation and destruction) of those "Link-Pairs" (the two Winsock-instances which make up a Link, with a ProxyClass-instance as the middle-man).

In a normal Surfing-scenario (even as a single User), you will produce a lot of "kept-alive" Connections when running a modern Browser.

In my test-sessions I saw the "Link-Pair-Count" go up to 20-30 Link-Pairs (though not much more) - but that means that 40-60 socket-instances were involved then in total.

In case you want to take a look, I've just posted an example in the VB6-codebank...

Olaf

I was hoping that I could force my browser to close a keep alive connection. A properly programmed browser, when a keepalive connection gets closed (against what it supposed to happen with a keep alive connection), is suppose to attempt to start it up again (even though it should have stayed open to start with), and if the server (in this case the proxy) is unable to accept the new connection, the browser is suppose to keep trying until it can be made (as soon as my proxy is done with the current connection its working with). The browser is supposed to continue this pattern of behavior until the entire webpage has loaded. Unfortunately Firefox is a broken browser. I good browser would be able to fully load a web page despite a broken proxy. If a keepalive connection is closed incorrectly by my proxy. Firefox give up on it, or mistakenly thinks it is still open! The result is that the web page never finishes loading. Yes my proxy server is "broken" as far as the specs are concerned. It's easier to make that way, so I made it that way. But the browser (if it's NOT broken) is supposed to compensate. Each part of the system is supposed to be able to pick up, where the other leaves off, in terms of functionality.