Privoxy is a free (this does not refer to its cost, free as in freedom), GPLed privacy proxy. It derives from Internet Junkbuster, which has been created by the Junkbusters, an american privacy group. It features, among others, regexp-based ad filtering, selective cookie blocking, popup-killing, ...
Have a look at the official privoxy homepage.
I'm currently adding IPv6 support to privoxy. My work is available from Deep Space 6.
The patch is currently tested only on various GNU/Linux distributions (GNU libc 2.2 and 2.3), and FreeBSD. Testers for other (particularly, non-Unixy) systems are welcome: Contact me, at the address “lionel” in the “mamane” second-level domain of the luxembourgish country code toplevel domain. The country code for Luxembourg is “lu”.