Indy : Http Proxy

Hi,

Should be an easy one this, but I am struggling...

I need to create an Http proxy server, and have been looking at the Indy
proxy demo using the TidMappedTCPServer class.  So far so good.

What I need to do in the proxy server is the following..

1) Get the client IP
2) Get the destination URL and maybe change it
3) Get at all the returning 'text' between <HTML> and </HTML> and maybe
change it before it is returned to the client.

(1) is easy, but I am struggling with (2) and (3), any pointers would be
very much appreciated.

Dave