ScriptEngineManager mgr = new ScriptEngineManager();
final ScriptEngine engine = mgr.getEngineByName("JavaScript");
Compilable compilable = (Compilable) engine;
final CompiledScript script = compilable.compile(baos.toString());
proxy.addRequestInterceptor(new RequestInterceptor() {
@Override
public void process(BrowserMobHttpRequest request) {
Bindings bindings = engine.createBindings();
bindings.put("request", request);
bindings.put("log", LOG);