Building a transparent proxy (if that is what I need)
Posted on 2006-07-17
I am building an internet gateway. The device is a WinXPPro box with two ethernet interfaces (LAN and WAN). I need to be able to intercept all web requests (HTTP + HTTPS) regardless of the port, and process the request.
For example, if a user on the LAN interface opens up a browser and tries to go to google.com, then I want to redirect them to the local web server where they receive a login page instead. Once the user successfully logs in, then I want to redirect them back to their requested page.
I assume that I need to create a proxy of some kind in order to be able to intercept the traffic? It would have to be transparent to the user as this device is for a public access location (wifi hotspot, internet cafe), so I cannot set a proxy address in the browser.
I guess I am looking for a C++ DLL component to allow me to do this from VB. I am a VB/ASP/SQL developer but I realise that in order to handle 100s (max of about 2000) concurrent user requests, then something a little more thread-friendly like C++ must be used. I have not the time to improve my scarce C knowledge to build this in C.
Please let me know if I am on the right track, or if there is a better way to do this. The rest of the TCPIP access is controlled by a firewall, for which my application creates rules for the user, on the fly when they successfully log in, and then deletes the rule when they log off or their time expires.