Do you mean, a home network with a proxy server between your router and your computer, or one of those http proxy servers you find on the net that scam people? :P
As stated above squid is fantatic, here is a
link.
If you want to build a firewall, use smooth wall.
You can write your own proxy, I'm making one in C, so if you want I can send you the code I've wrote (its a working progress, it isnt fully working)