I am trying to write a forward proxy in Jetty using Servlet 3.0.
I\'ve a simple code-
public class testServlet
You're doing this wrong. The Servlet API and framework is for writing servlets, i.e. endpoints. Not for writing HTTP proxies. HTTP proxies are fundamentally very simple things that understand one command, CONNECT, and then just copy bytes in both directions. Even if you could make this work as a servlet, which you almost certainly can't, the performance impact would be atrocious, as the container would read the entire request before calling you, and probably buffer the response as well. You don't want all that added latency.