server.addContext(context);
handler = new BrowserMobProxyHandler();
handler.setJettyServer(server);
handler.setShutdownLock(new Object());
client = new BrowserMobHttpClient(streamManager, requestCounter);
client.prepareForBrowser();
handler.setHttpClient(client);
context.addHandler(handler);