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.