update proxy example

This commit is contained in:
Jesse McConnell 2013-06-03 12:44:19 -05:00
parent fc87693ba9
commit 8b39cbe5bf
1 changed files with 1 additions and 5 deletions

View File

@ -32,19 +32,15 @@ public class ProxyServer
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();
// proxy.setWhite(new String[]{"mail.google.com"});
// proxy.addWhitelistHost("www.google.com");
server.setHandler(proxy);
// Setup proxy servlet
ServletContextHandler context = new ServletContextHandler(proxy, "/", ServletContextHandler.SESSIONS);
ServletHolder proxyServlet = new ServletHolder(ProxyServlet.class);
// proxyServlet.setInitParameter("whiteList", "google.com, www.eclipse.org, localhost");
// proxyServlet.setInitParameter("blackList", "google.com/calendar/*, www.eclipse.org/committers/");
proxyServlet.setInitParameter("blackList", "www.eclipse.org");
context.addServlet(proxyServlet, "/*");
server.start();