Java as Filtering Web Content

does anyone have ever do filtering the web content using java app?
I thought that this could be used, when we apply some socketserver into our localhost itself.
And with another socket to connect to the real web domain (address).

(take note: that our machine is connected to the internet line).

And...
The problem arose when the bytes received from the real web domain (address) translated from
inputstream... which makes the loading ... output appearance at our browser seems slow.