Proxy servlet code. Mostly working. Not complete