views:

116

answers:

3

I would like to make an HTTP/S proxy program to filter/deny certain http traffic based on how I parse the HTTP request in C++.

Is there some kind of starting point code that I can use with an open license for commercial use? For example if I wanted to do a project on searching I would start with lucene.

+3  A: 

Have a look at Squid (developers section).

Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-requested web pages. Squid has extensive access controls and makes a great server accelerator. It runs on most available operating systems, including Windows and is licensed under the GNU GPL.

jldupont
+1 for the "standard" solution.
slebetman
+3  A: 

nginx is a high performance HTTP/S server written in C that can be used as a proxy.

It has a easy to use module system for which you can write plugins. You should consider using an existing parser like Ragel to help you on the filtering side.

It is licensed under a BSD-like license which is fine for commercial use.

Michael Greene
+1  A: 

You can't see the request at a proxy for HTTPS traffic - SSL is specifically designed to prevent this.

You could terminate the SSL connection at the proxy but would need to either rewrite all the URLs in the content to be non-SSL before passwing back to the client or install your skae oil CA Cert on all the clients and generate certificates on the fly.

If you just want to play around with HTTP, then SQUID alreay has hooks built-in to implement your own filtering mechanism.

C.

symcbean
Can I get the request URL from a HTTPS request at the proxy?
Tong Wang
No - "You can't see the request at a proxy for HTTPS traffic"C.
symcbean