jarib/browsermob-proxy-rb — pull request #27 by vgrigoruk (2014-06-09 20:50:25+00:00)
Title: added support for request / response interception

Added support for injection of request / response interceptors (javascript code). Details are here: https://github.com/lightbody/browsermob-proxy#http-request-manipulation

Example usage (appending some string to user-agent):

```
INTERCEPTOR = <<-eos
userAgent = request.getMethod().getFirstHeader("User-Agent").getValue();
request.getMethod().setHeader("User-Agent", userAgent + " CUSTOM_STRING");
eos

proxy_client = BrowserMob::Proxy::Client.from(proxy_url)
proxy_client.request_interceptor = INTERCEPTOR
```