views:

439

answers:

2

I am trying to create a SOCKS proxy in C++ that runs as a background process on localhost.

If the user's browser is configured to use the proxy, I want all HTTP requests to be passed along through the normal TCP/IP stack. i.e. The browser will behave exactly as it normally would.

Eventually I will add another layer which will check to see if the requested resource matches certain criteria, and if so will handle the request differently. But for now I'm just trying to solve the basic problem... how to create a SOCKS proxy that doesn't change anything?

+1  A: 

I would look into the Squid project, depending on what you need it for.

http://www.squid-cache.org/

GPL licensed source.

Insanely nice for many good things.

Jacob

TheJacobTaylor
A: 

It is far easier to build a HTTP Proxy then a SOCKS4/SOCKS5 as HTTP protocol is human readable and SOCKS protocols are not. Here is an exemple of a HTTP proxy I build for experience some years ago. It used to work fine with old browsers, now its broken as it cannot handle persistent connections, but it still is a good source to learn how it works.

Maybe you rather use a already existing HTTP proxy software like Squid.

Havenard
I will be reconfiguring the browser so that DNS requests are also made through the proxy. I suspect this means I cannot use a HTTP proxy.
rwired
It is not a problem at all.
Havenard