Just discovered something by making a mistake.
Server server = new Server();
ServerConnector connector = new ServerConnector(server);
connector.setPort(8888);
server.addConnector(connector);
// Setup proxy handler to handle CONNECT methods
ConnectHandler proxy = new ConnectHandler();
server.setHandler(proxy);
// Setup proxy servlet
ServletContextHandler context = new ServletContextHandler(proxy, "/", ServletContextHandler.SESSIONS);
ServletHolder proxyServlet = new ServletHolder(MyProxy.class);
context.addServlet(proxyServlet, "/*");
System.out.println("Starting the proxy server");
server.start();
By mistake I have commented out the context.addServlet() command, like this
Server server = new Server();
ServerConnector connector = new ServerConnector(server);
connector.setPort(8888);
server.addConnector(connector);
// Setup proxy handler to handle CONNECT methods
ConnectHandler proxy = new ConnectHandler();
server.setHandler(proxy);
// Setup proxy servlet
ServletContextHandler context = new ServletContextHandler(proxy, "/", ServletContextHandler.SESSIONS);
ServletHolder proxyServlet = new ServletHolder(MyProxy.class);
//context.addServlet(proxyServlet, "/*");
System.out.println("Starting the proxy server");
server.start();
The result was:
- access to any website was not possible
- access to this particular web site I want to trace was possible. It kept working and I coud use it.
What does this means?
I have used Burp to intercept the requests, they are all post and get requests, http 1.1
So what is the Jetty component doing the job in this case? Has it a default servlet handler?
Any idea
Gilles