update proxy example
This commit is contained in:
parent
fc87693ba9
commit
8b39cbe5bf
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue