Giter Club home page Giter Club logo

browsermob-proxy's People

Contributors

abotalov avatar antonecma avatar bzrmeglino avatar cburroughs avatar chetankothari avatar controllerface avatar dareboost avatar davbo avatar dereke avatar djtm avatar flopezluis avatar gomezd avatar hellspam avatar jeffriejoshua avatar jekh avatar lightbody avatar lucabox avatar michalsvec avatar neoalienson avatar nirvdrum avatar nite23 avatar rac2030 avatar rexhoffman avatar romovs avatar roydekleijn avatar schamper avatar selenium34 avatar watsonmw avatar wormyourhonor avatar zymosi3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

browsermob-proxy's Issues

Proxy stuck on trying to parse User Agent

Hi,
Today I've been pulling my hair out, trying to debug something in our test framework, and then suddenly all tests just started failing for seemingly no reason.

After delving in to the bmp code, I found out that when using CachingOnlineUpdateUASparser.parse, you create a http request to http://user-agent-string.info/rpc/get_data.php?key=free&format=ini , and that request was blocked. Apparently the website was down, and because of that no requests are being sent via the proxy.

Mind adding a fix for that? I mean, depending on a third party website just to run my tests seems a bit silly.

Dns remapping with rest api

Good Morning,

i have an issue using dns remapping feature as manual described.

To test this feature after proxy creation i use

curl --data '{"www.example.com":"5.97.112.67"}' http://localhost:6666/proxy/9092/hosts

The browsermob proxy server returned me an error like

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 500 Binding expression (request/form parameter) contained invalid characters: {"www.example.com":"5.97.112.67"}</title>
</head>
<body>
<h2>HTTP ERROR: 500</h2>
<p>Problem accessing /proxy/9092/hosts. Reason:
<pre>    Binding expression (request/form parameter) contained invalid characters: {"www.example.com":"5.97.112.67"}</pre></p>
<hr /><i><small>Powered by Jetty://</small></i>
</body>
</html>

Serverside stacktrace log start with

com.google.sitebricks.binding.InvalidBindingException: Binding expression (request/form parameter) contained invalid characters: {"www.example.com":"5.97.112.67"}

Something wrong in my operation or .. ?

Add way to delete rewrite rules.

I've been using rewrites a lot with a single persistent proxy. It would be convenient if after you created a rewrite with

curl -X PUT -d "matchRegex=something &replace=foo" http://localhost:9090/proxy/[port]/rewrite

we could do something like:

curl -X DELETE -d "matchRegex=something " http://localhost:9090/proxy/[port]/rewrite

or:

curl -X DELETE http://localhost:9090/proxy/[port]/rewrite/something%20

to remove all rewrites that use that matchRegex. Otherwise I have to restart the proxy (and any dependent services relying on the proxy) when I want to use a different set of rewrite rules.

Unable to read HAR files generated from Chrome Developer Tools

Currently exporting a file from Chrome Developer Tools Network Tab (right click -> Save as HAR with Content or Copy all as HAR and saving to a file) fails.

Here is a small JUnit test to reproduce:

    private static Har har;

    @Before
    public void setup() throws JsonParseException, JsonMappingException, IOException {
        har = new ObjectMapper().readValue(UtilsTest.class.getResourceAsStream("/github.com.har"), Har.class);
    }

    @Test
    public void iterateEntries() {
       for (HarEntry entry : har.getLog().getEntries()) {
           System.out.println(entry.getTime());
       }
    }

I can't attach the har file to this, so I will paste it in below:

{"log":{"version":"1.2","creator":{"name":"WebInspector","version":"537.36"},"pages":[{"startedDateTime":"2013-07-22T17:28:45.598Z","id":"page_1","title":"https://github.com/webmetrics/browsermob-proxy/blob/master/src/main/java/org/browsermob/core/har/HarCookie.java","pageTimings":{"onContentLoad":986,"onLoad":1188}}],"entries":[{"startedDateTime":"2013-07-22T17:28:45.598Z","time":243,"request":{"method":"GET","url":"https://github.com/webmetrics/browsermob-proxy/blob/master/src/main/java/org/browsermob/core/har/HarCookie.java","httpVersion":"HTTP/1.1","headers":[{"name":"Accept","value":"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"},{"name":"Connection","value":"keep-alive"},{"name":"Accept-Encoding","value":"gzip,deflate,sdch"},{"name":"Host","value":"github.com"},{"name":"Accept-Language","value":"en-US,en;q=0.8"},{"name":"User-Agent","value":"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36"}],"queryString":[],"cookies":[],"headersSize":416,"bodySize":0},"response":{"status":200,"statusText":"OK","httpVersion":"HTTP/1.1","headers":[{"name":"X-Runtime","value":"40"},{"name":"Date","value":"Mon, 22 Jul 2013 17:28:45 GMT"},{"name":"Strict-Transport-Security","value":"max-age=2592000"},{"name":"Vary","value":"Accept-Encoding"},{"name":"Server","value":"GitHub.com"},{"name":"X-Frame-Options","value":"deny"},{"name":"ETag","value":"\"e5e6fcf495670391fb60006559c07bb2\""},{"name":"Transfer-Encoding","value":"chunked"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Status","value":"200 OK"},{"name":"Set-Cookie","value":"logged_in=no; domain=.github.com; path=/; expires=Fri, 22-Jul-2033 17:28:45 GMT; secure; HttpOnly"},{"name":"Set-Cookie","value":"dotcom_user=; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT"},{"name":"Set-Cookie","value":"_gh_sess=BAh7BzoPc2Vzc2lvbl9pZCIlMGI3NzliYzFlMTMyOTVlNzQ3N2ZmZjExZGNjOTg0ODM6EF9jc3JmX3Rva2VuSSIxa3NVMEcvZ3Vvdnh1OHZNdnB3K09oMHk3WWplakQ3Q01GN09CczFWTzVSWT0GOgZFRg%3D%3D--fd07e039df7aa192ca4c56b82ab1e18985782d75; path=/; expires=Sun, 01-Jan-2023 00:00:00 GMT; secure; HttpOnly"},{"name":"Cache-Control","value":"private, max-age=0, must-revalidate"},{"name":"Content-Security-Policy","value":"default-src *; script-src 'self' https://github.global.ssl.fastly.net https://jobs.github.com https://ssl.google-analytics.com https://collector.githubapp.com https://gist.github.com; style-src 'self' 'unsafe-inline' https://github.global.ssl.fastly.net; object-src 'self' https://github.global.ssl.fastly.net"},{"name":"Connection","value":"keep-alive"},{"name":"Content-Encoding","value":"gzip"}],"cookies":[{"name":"logged_in","value":"no","path":"/","domain":".github.com","expires":"2033-07-22T17:28:45.000Z","httpOnly":true,"secure":true},{"name":"dotcom_user","value":"","path":"/","expires":"1970-01-01T00:00:00.000Z","httpOnly":false,"secure":false},{"name":"_gh_sess","value":"BAh7BzoPc2Vzc2lvbl9pZCIlMGI3NzliYzFlMTMyOTVlNzQ3N2ZmZjExZGNjOTg0ODM6EF9jc3JmX3Rva2VuSSIxa3NVMEcvZ3Vvdnh1OHZNdnB3K09oMHk3WWplakQ3Q01GN09CczFWTzVSWT0GOgZFRg%3D%3D--fd07e039df7aa192ca4c56b82ab1e18985782d75","path":"/","expires":"2023-01-01T00:00:00.000Z","httpOnly":true,"secure":true}],"content":{"size":44907,"mimeType":"text/html","compression":35644},"redirectURL":"","headersSize":1217,"bodySize":9263},"cache":{},"timings":{"blocked":0,"dns":0,"connect":100,"send":-69,"wait":121,"receive":16,"ssl":69},"pageref":"page_1"},{"startedDateTime":"2013-07-22T17:28:45.883Z","time":285,"request":{"method":"GET","url":"https://github.global.ssl.fastly.net/assets/github-8921d913c104b05dbca482140b50a4899d808da0.css","httpVersion":"HTTP/1.1","headers":[{"name":"Accept","value":"text/css,*/*;q=0.1"},{"name":"Connection","value":"keep-alive"},{"name":"Accept-Encoding","value":"gzip,deflate,sdch"},{"name":"Referer","value":"https://github.com/webmetrics/browsermob-proxy/blob/master/src/main/java/org/browsermob/core/har/HarCookie.java"},{"name":"Host","value":"github.global.ssl.fastly.net"},{"name":"Accept-Language","value":"en-US,en;q=0.8"},{"name":"User-Agent","value":"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36"}],"queryString":[],"cookies":[],"headersSize":477,"bodySize":0},"response":{"status":200,"statusText":"OK","httpVersion":"HTTP/1.1","headers":[{"name":"Date","value":"Mon, 22 Jul 2013 17:28:46 GMT"},{"name":"Content-Encoding","value":"gzip"},{"name":"Age","value":"126890"},{"name":"X-Cache","value":"HIT"},{"name":"Connection","value":"Keep-Alive"},{"name":"Content-Length","value":"61658"},{"name":"X-Served-By","value":"cache-c31-CHI"},{"name":"Last-Modified","value":"Sun, 21 Jul 2013 06:12:43 GMT"},{"name":"Server","value":"GitHub.com"},{"name":"X-Timer","value":"S1374514126.073489666,VS0,VE0"},{"name":"Vary","value":"Accept-Encoding"},{"name":"Content-Type","value":"text/css"},{"name":"Via","value":"1.1 varnish"},{"name":"Expires","value":"Mon, 21 Jul 2014 06:13:55 GMT"},{"name":"Cache-Control","value":"max-age=31536000, public"},{"name":"Accept-Ranges","value":"bytes"},{"name":"Keep-Alive","value":"timeout=10, max=50"},{"name":"X-Cache-Hits","value":"30346"}],"cookies":[],"content":{"size":263725,"mimeType":"text/css","compression":201842},"redirectURL":"","headersSize":509,"bodySize":61883},"cache":{},"timings":{"blocked":0,"dns":0,"connect":108,"send":-74,"wait":37,"receive":75,"ssl":74},"pageref":"page_1"},{"startedDateTime":"2013-07-22T17:28:45.884Z","time":295,"request":{"method":"GET","url":"https://github.global.ssl.fastly.net/assets/github2-07b5a2f9ead69e413a4a39b8bf0414aba066b0aa.css","httpVersion":"HTTP/1.1","headers":[{"name":"Accept","value":"text/css,*/*;q=0.1"},{"name":"Connection","value":"keep-alive"},{"name":"Accept-Encoding","value":"gzip,deflate,sdch"},{"name":"Referer","value":"https://github.com/webmetrics/browsermob-proxy/blob/master/src/main/java/org/browsermob/core/har/HarCookie.java"},{"name":"Host","value":"github.global.ssl.fastly.net"},{"name":"Accept-Language","value":"en-US,en;q=0.8"},{"name":"User-Agent","value":"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36"}],"queryString":[],"cookies":[],"headersSize":478,"bodySize":0},"response":{"status":200,"statusText":"OK","httpVersion":"HTTP/1.1","headers":[{"name":"Date","value":"Mon, 22 Jul 2013 17:28:46 GMT"},{"name":"Content-Encoding","value":"gzip"},{"name":"Age","value":"258809"},{"name":"X-Cache","value":"HIT"},{"name":"Connection","value":"Keep-Alive"},{"name":"Content-Length","value":"41371"},{"name":"X-Served-By","value":"cache-c32-CHI"},{"name":"Last-Modified","value":"Fri, 19 Jul 2013 17:34:34 GMT"},{"name":"Server","value":"GitHub.com"},{"name":"X-Timer","value":"S1374514126.075096607,VS0,VE0"},{"name":"Vary","value":"Accept-Encoding"},{"name":"Content-Type","value":"text/css"},{"name":"Via","value":"1.1 varnish"},{"name":"Expires","value":"Sat, 19 Jul 2014 17:35:17 GMT"},{"name":"Cache-Control","value":"max-age=31536000, public"},{"name":"Accept-Ranges","value":"bytes"},{"name":"Keep-Alive","value":"timeout=10, max=50"},{"name":"X-Cache-Hits","value":"56900"}],"cookies":[],"content":{"size":178868,"mimeType":"text/css","compression":137322},"redirectURL":"","headersSize":509,"bodySize":41546},"cache":{},"timings":{"blocked":0,"dns":0,"connect":108,"send":-73,"wait":37,"receive":85,"ssl":73},"pageref":"page_1"},{"startedDateTime":"2013-07-22T17:28:45.883Z","time":349,"request":{"method":"GET","url":"https://github.global.ssl.fastly.net/assets/frameworks-e8054ad804a1cf9e9849130fee5a4a5487b663ed.js","httpVersion":"HTTP/1.1","headers":[{"name":"Accept","value":"*/*"},{"name":"Connection","value":"keep-alive"},{"name":"Accept-Encoding","value":"gzip,deflate,sdch"},{"name":"Referer","value":"https://github.com/webmetrics/browsermob-proxy/blob/master/src/main/java/org/browsermob/core/har/HarCookie.java"},{"name":"Host","value":"github.global.ssl.fastly.net"},{"name":"Accept-Language","value":"en-US,en;q=0.8"},{"name":"User-Agent","value":"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36"}],"queryString":[],"cookies":[],"headersSize":465,"bodySize":0},"response":{"status":200,"statusText":"OK","httpVersion":"HTTP/1.1","headers":[{"name":"Date","value":"Mon, 22 Jul 2013 17:28:46 GMT"},{"name":"Content-Encoding","value":"gzip"},{"name":"Age","value":"948537"},{"name":"X-Cache","value":"HIT"},{"name":"Connection","value":"Keep-Alive"},{"name":"Content-Length","value":"119083"},{"name":"X-Served-By","value":"cache-c32-CHI"},{"name":"Last-Modified","value":"Thu, 11 Jul 2013 02:35:41 GMT"},{"name":"Server","value":"GitHub.com"},{"name":"X-Timer","value":"S1374514126.076790333,VS0,VE0"},{"name":"Vary","value":"Accept-Encoding"},{"name":"Content-Type","value":"application/x-javascript"},{"name":"Via","value":"1.1 varnish"},{"name":"Expires","value":"Fri, 11 Jul 2014 17:59:49 GMT"},{"name":"Cache-Control","value":"max-age=31536000, public"},{"name":"Accept-Ranges","value":"bytes"},{"name":"Keep-Alive","value":"timeout=10, max=50"},{"name":"X-Cache-Hits","value":"207536"}],"cookies":[],"content":{"size":314057,"mimeType":"application/x-javascript","compression":194574},"redirectURL":"","headersSize":527,"bodySize":119483},"cache":{},"timings":{"blocked":0,"dns":0,"connect":108,"send":-74,"wait":37,"receive":138,"ssl":74},"pageref":"page_1"},{"startedDateTime":"2013-07-22T17:28:45.884Z","time":330,"request":{"method":"GET","url":"https://github.global.ssl.fastly.net/assets/github-4e41d7724d8be5d39a03f8e6bf2d50a4414b9649.js","httpVersion":"HTTP/1.1","headers":[{"name":"Accept","value":"*/*"},{"name":"Connection","value":"keep-alive"},{"name":"Accept-Encoding","value":"gzip,deflate,sdch"},{"name":"Referer","value":"https://github.com/webmetrics/browsermob-proxy/blob/master/src/main/java/org/browsermob/core/har/HarCookie.java"},{"name":"Host","value":"github.global.ssl.fastly.net"},{"name":"Accept-Language","value":"en-US,en;q=0.8"},{"name":"User-Agent","value":"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36"}],"queryString":[],"cookies":[],"headersSize":461,"bodySize":0},"response":{"status":200,"statusText":"OK","httpVersion":"HTTP/1.1","headers":[{"name":"Date","value":"Mon, 22 Jul 2013 17:28:46 GMT"},{"name":"Content-Encoding","value":"gzip"},{"name":"Age","value":"126890"},{"name":"X-Cache","value":"HIT"},{"name":"Connection","value":"Keep-Alive"},{"name":"Content-Length","value":"98263"},{"name":"X-Served-By","value":"cache-c48-CHI"},{"name":"Last-Modified","value":"Sun, 21 Jul 2013 06:12:42 GMT"},{"name":"Server","value":"GitHub.com"},{"name":"X-Timer","value":"S1374514126.077344656,VS0,VE0"},{"name":"Vary","value":"Accept-Encoding"},{"name":"Content-Type","value":"application/x-javascript"},{"name":"Via","value":"1.1 varnish"},{"name":"Expires","value":"Mon, 21 Jul 2014 06:13:55 GMT"},{"name":"Cache-Control","value":"max-age=31536000, public"},{"name":"Accept-Ranges","value":"bytes"},{"name":"Keep-Alive","value":"timeout=10, max=50"},{"name":"X-Cache-Hits","value":"30051"}],"cookies":[],"content":{"size":326692,"mimeType":"application/x-javascript","compression":228079},"redirectURL":"","headersSize":525,"bodySize":98613},"cache":{},"timings":{"blocked":0,"dns":0,"connect":108,"send":-74,"wait":37,"receive":117,"ssl":74},"pageref":"page_1"},{"startedDateTime":"2013-07-22T17:28:46.411Z","time":217,"request":{"method":"GET","url":"https://github.global.ssl.fastly.net/images/spinners/octocat-spinner-32.gif","httpVersion":"HTTP/1.1","headers":[{"name":"Accept","value":"image/webp,*/*;q=0.8"},{"name":"Connection","value":"keep-alive"},{"name":"Accept-Encoding","value":"gzip,deflate,sdch"},{"name":"Referer","value":"https://github.com/webmetrics/browsermob-proxy/blob/master/src/main/java/org/browsermob/core/har/HarCookie.java"},{"name":"Host","value":"github.global.ssl.fastly.net"},{"name":"Accept-Language","value":"en-US,en;q=0.8"},{"name":"User-Agent","value":"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36"}],"queryString":[],"cookies":[],"headersSize":459,"bodySize":0},"response":{"status":200,"statusText":"OK","httpVersion":"HTTP/1.1","headers":[{"name":"Date","value":"Mon, 22 Jul 2013 17:28:46 GMT"},{"name":"Via","value":"1.1 varnish"},{"name":"Age","value":"948537"},{"name":"X-Cache","value":"HIT"},{"name":"Connection","value":"Keep-Alive"},{"name":"Content-Length","value":"2310"},{"name":"X-Served-By","value":"cache-c32-CHI"},{"name":"Last-Modified","value":"Mon, 25 Jun 2012 21:25:11 GMT"},{"name":"Server","value":"GitHub.com"},{"name":"X-Timer","value":"S1374514126.253284216,VS0,VE0"},{"name":"Vary","value":"Accept-Encoding"},{"name":"Content-Type","value":"image/gif"},{"name":"Expires","value":"Fri, 11 Jul 2014 17:59:49 GMT"},{"name":"Cache-Control","value":"max-age=31536000, public"},{"name":"Accept-Ranges","value":"bytes"},{"name":"Keep-Alive","value":"timeout=10, max=49"},{"name":"X-Cache-Hits","value":"208996"}],"cookies":[],"content":{"size":2310,"mimeType":"image/gif","compression":-50},"redirectURL":"","headersSize":486,"bodySize":2360},"cache":{},"timings":{"blocked":-1,"dns":-1,"connect":-1,"send":0,"wait":35,"receive":178,"ssl":-1},"pageref":"page_1"},{"startedDateTime":"2013-07-22T17:28:46.256Z","time":421,"request":{"method":"GET","url":"https://secure.gravatar.com/avatar/6ae44f6680b12511e4f8c81537c3cd35?s=140&d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","httpVersion":"HTTP/1.1","headers":[{"name":"method","value":"GET"},{"name":"accept-encoding","value":"gzip,deflate,sdch"},{"name":"host","value":"secure.gravatar.com"},{"name":"accept-language","value":"en-US,en;q=0.8"},{"name":"user-agent","value":"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36"},{"name":"accept","value":"image/webp,*/*;q=0.8"},{"name":"referer","value":"https://github.com/webmetrics/browsermob-proxy/blob/master/src/main/java/org/browsermob/core/har/HarCookie.java"},{"name":"url","value":"/avatar/6ae44f6680b12511e4f8c81537c3cd35?s=140&d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png"},{"name":"version","value":"HTTP/1.1"},{"name":"scheme","value":"https"}],"queryString":[{"name":"s","value":"140"},{"name":"d","value":"https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png"}],"cookies":[],"headersSize":740,"bodySize":0},"response":{"status":200,"statusText":"OK","httpVersion":"HTTP/1.1","headers":[{"name":"date","value":"Mon, 22 Jul 2013 17:28:46 GMT"},{"name":"via","value":"1.1 varnish"},{"name":"last-modified","value":"Sat, 20 Jun 2009 17:34:37 GMT"},{"name":"server","value":"nginx"},{"name":"version","value":"HTTP/1.1"},{"name":"status","value":"200"},{"name":"content-type","value":"image/jpeg"},{"name":"access-control-allow-origin","value":"*"},{"name":"cache-control","value":"max-age=300"},{"name":"x-varnish","value":"2726661249 2725966721"},{"name":"content-disposition","value":"inline; filename=\"6ae44f6680b12511e4f8c81537c3cd35.jpeg\""},{"name":"content-length","value":"9018"},{"name":"expires","value":"Mon, 22 Jul 2013 17:33:46 GMT"}],"cookies":[],"content":{"size":9018,"mimeType":"image/jpeg","compression":-2860},"redirectURL":"","headersSize":428,"bodySize":11878},"cache":{},"timings":{"blocked":0,"dns":1,"connect":311,"send":-275,"wait":77,"receive":23,"ssl":275},"pageref":"page_1"},{"startedDateTime":"2013-07-22T17:28:46.256Z","time":423,"request":{"method":"GET","url":"https://secure.gravatar.com/avatar/26d56d0c6c57d3b7fdd01a15917ecfde?s=140&d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","httpVersion":"HTTP/1.1","headers":[{"name":"method","value":"GET"},{"name":"accept-encoding","value":"gzip,deflate,sdch"},{"name":"host","value":"secure.gravatar.com"},{"name":"accept-language","value":"en-US,en;q=0.8"},{"name":"user-agent","value":"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36"},{"name":"accept","value":"image/webp,*/*;q=0.8"},{"name":"referer","value":"https://github.com/webmetrics/browsermob-proxy/blob/master/src/main/java/org/browsermob/core/har/HarCookie.java"},{"name":"url","value":"/avatar/26d56d0c6c57d3b7fdd01a15917ecfde?s=140&d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png"},{"name":"version","value":"HTTP/1.1"},{"name":"scheme","value":"https"}],"queryString":[{"name":"s","value":"140"},{"name":"d","value":"https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png"}],"cookies":[],"headersSize":740,"bodySize":0},"response":{"status":200,"statusText":"OK","httpVersion":"HTTP/1.1","headers":[{"name":"date","value":"Mon, 22 Jul 2013 17:28:46 GMT"},{"name":"via","value":"1.1 varnish"},{"name":"last-modified","value":"Wed, 13 May 2009 01:29:09 GMT"},{"name":"server","value":"nginx"},{"name":"version","value":"HTTP/1.1"},{"name":"status","value":"200"},{"name":"content-type","value":"image/png"},{"name":"access-control-allow-origin","value":"*"},{"name":"cache-control","value":"max-age=300"},{"name":"x-varnish","value":"876712066 872652097"},{"name":"content-disposition","value":"inline; filename=\"26d56d0c6c57d3b7fdd01a15917ecfde.png\""},{"name":"content-length","value":"12615"},{"name":"expires","value":"Mon, 22 Jul 2013 17:33:46 GMT"}],"cookies":[],"content":{"size":12615,"mimeType":"image/png","compression":13040},"redirectURL":"","headersSize":425,"bodySize":-425},"cache":{},"timings":{"blocked":-1,"dns":-1,"connect":-1,"send":1,"wait":76,"receive":25,"ssl":-1},"pageref":"page_1"},{"startedDateTime":"2013-07-22T17:28:46.485Z","time":142,"request":{"method":"GET","url":"https://ssl.google-analytics.com/ga.js","httpVersion":"HTTP/1.1","headers":[{"name":":host","value":"ssl.google-analytics.com"},{"name":"accept-encoding","value":"gzip,deflate,sdch"},{"name":"accept-language","value":"en-US,en;q=0.8"},{"name":"user-agent","value":"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36"},{"name":":path","value":"/ga.js"},{"name":"accept","value":"*/*"},{"name":":version","value":"HTTP/1.1"},{"name":"referer","value":"https://github.com/webmetrics/browsermob-proxy/blob/master/src/main/java/org/browsermob/core/har/HarCookie.java"},{"name":":scheme","value":"https"},{"name":":method","value":"GET"}],"queryString":[],"cookies":[],"headersSize":477,"bodySize":0},"response":{"status":200,"statusText":"OK","httpVersion":"HTTP/1.1","headers":[{"name":"date","value":"Mon, 22 Jul 2013 11:39:50 GMT"},{"name":"content-encoding","value":"gzip"},{"name":"x-content-type-options","value":"nosniff"},{"name":"last-modified","value":"Tue, 18 Jun 2013 17:15:47 GMT"},{"name":"server","value":"GFE/2.0"},{"name":"age","value":"20936"},{"name":"vary","value":"Accept-Encoding"},{"name":"content-type","value":"text/javascript"},{"name":"status","value":"200 OK"},{"name":"expires","value":"Mon, 22 Jul 2013 23:39:50 GMT"},{"name":"cache-control","value":"max-age=43200, public"},{"name":"content-length","value":"15612"},{"name":"version","value":"HTTP/1.1"}],"cookies":[],"content":{"size":39714,"mimeType":"text/javascript","compression":23672},"redirectURL":"","headersSize":378,"bodySize":16042},"cache":{},"timings":{"blocked":0,"dns":0,"connect":49,"send":-31,"wait":20,"receive":70,"ssl":31},"pageref":"page_1"},{"startedDateTime":"2013-07-22T17:28:46.574Z","time":156,"request":{"method":"GET","url":"https://collector.githubapp.com/assets/api.js","httpVersion":"HTTP/1.1","headers":[{"name":"Accept","value":"*/*"},{"name":"Connection","value":"keep-alive"},{"name":"Accept-Encoding","value":"gzip,deflate,sdch"},{"name":"Referer","value":"https://github.com/webmetrics/browsermob-proxy/blob/master/src/main/java/org/browsermob/core/har/HarCookie.java"},{"name":"Host","value":"collector.githubapp.com"},{"name":"Accept-Language","value":"en-US,en;q=0.8"},{"name":"User-Agent","value":"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36"}],"queryString":[],"cookies":[],"headersSize":412,"bodySize":0},"response":{"status":200,"statusText":"OK","httpVersion":"HTTP/1.1","headers":[{"name":"Date","value":"Mon, 22 Jul 2013 17:28:46 GMT"},{"name":"Content-Encoding","value":"gzip"},{"name":"Last-Modified","value":"Tue, 11 Jun 2013 15:18:08 GMT"},{"name":"Server","value":"GitHub.com"},{"name":"Vary","value":"Accept-Encoding"},{"name":"Content-Type","value":"application/x-javascript"},{"name":"Transfer-Encoding","value":"chunked"},{"name":"Connection","value":"keep-alive"}],"cookies":[],"content":{"size":4063,"mimeType":"application/x-javascript","compression":2520},"redirectURL":"","headersSize":261,"bodySize":1543},"cache":{},"timings":{"blocked":0,"dns":0,"connect":115,"send":-79,"wait":37,"receive":3,"ssl":79},"pageref":"page_1"},{"startedDateTime":"2013-07-22T17:28:46.611Z","time":64,"request":{"method":"GET","url":"https://github.global.ssl.fastly.net/assets/octicons-af6c4f6a290680bbd6b07b19f72690a360e5f355.woff","httpVersion":"HTTP/1.1","headers":[{"name":"Accept","value":"*/*"},{"name":"Connection","value":"keep-alive"},{"name":"Accept-Encoding","value":"gzip,deflate,sdch"},{"name":"Referer","value":"https://github.com/webmetrics/browsermob-proxy/blob/master/src/main/java/org/browsermob/core/har/HarCookie.java"},{"name":"Host","value":"github.global.ssl.fastly.net"},{"name":"Accept-Language","value":"en-US,en;q=0.8"},{"name":"User-Agent","value":"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36"}],"queryString":[],"cookies":[],"headersSize":465,"bodySize":0},"response":{"status":200,"statusText":"OK","httpVersion":"HTTP/1.1","headers":[{"name":"Date","value":"Mon, 22 Jul 2013 17:28:46 GMT"},{"name":"Via","value":"1.1 varnish"},{"name":"Age","value":"418894"},{"name":"X-Cache","value":"HIT"},{"name":"Connection","value":"Keep-Alive"},{"name":"Content-Length","value":"28172"},{"name":"X-Served-By","value":"cache-c32-CHI"},{"name":"Last-Modified","value":"Wed, 17 Jul 2013 21:06:13 GMT"},{"name":"Server","value":"GitHub.com"},{"name":"X-Timer","value":"S1374514126.605060339,VS0,VE0"},{"name":"Vary","value":"Accept-Encoding"},{"name":"Content-Type","value":"application/x-font-woff"},{"name":"Access-Control-Allow-Origin","value":"https://github.com"},{"name":"Expires","value":"Thu, 17 Jul 2014 21:07:12 GMT"},{"name":"Cache-Control","value":"max-age=31536000, public"},{"name":"Accept-Ranges","value":"bytes"},{"name":"Keep-Alive","value":"timeout=10, max=48"},{"name":"X-Cache-Hits","value":"94067"}],"cookies":[],"content":{"size":28172,"mimeType":"application/x-font-woff","compression":-125},"redirectURL":"","headersSize":549,"bodySize":28297},"cache":{},"timings":{"blocked":-1,"dns":-1,"connect":-1,"send":0,"wait":35,"receive":26,"ssl":-1},"pageref":"page_1"},{"startedDateTime":"2013-07-22T17:28:46.654Z","time":54,"request":{"method":"GET","url":"https://github.global.ssl.fastly.net/flash/ZeroClipboard.swf?nocache=1374514126557","httpVersion":"HTTP/1.1","headers":[{"name":"Accept","value":"*/*"},{"name":"Connection","value":"keep-alive"},{"name":"Accept-Encoding","value":"gzip,deflate,sdch"},{"name":"Referer","value":"https://github.com/webmetrics/browsermob-proxy/blob/master/src/main/java/org/browsermob/core/har/HarCookie.java"},{"name":"Host","value":"github.global.ssl.fastly.net"},{"name":"Accept-Language","value":"en-US,en;q=0.8"},{"name":"User-Agent","value":"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36"}],"queryString":[{"name":"nocache","value":"1374514126557"}],"cookies":[],"headersSize":449,"bodySize":0},"response":{"status":200,"statusText":"OK","httpVersion":"HTTP/1.1","headers":[{"name":"Date","value":"Mon, 22 Jul 2013 17:28:46 GMT"},{"name":"Via","value":"1.1 varnish"},{"name":"Age","value":"948535"},{"name":"X-Cache","value":"HIT"},{"name":"Connection","value":"Keep-Alive"},{"name":"Content-Length","value":"1635"},{"name":"X-Served-By","value":"cache-c32-CHI"},{"name":"Last-Modified","value":"Tue, 12 Feb 2013 06:00:47 GMT"},{"name":"Server","value":"GitHub.com"},{"name":"X-Timer","value":"S1374514126.655643463,VS0,VE0"},{"name":"Vary","value":"Accept-Encoding"},{"name":"Content-Type","value":"application/x-shockwave-flash"},{"name":"Expires","value":"Fri, 11 Jul 2014 17:59:51 GMT"},{"name":"Cache-Control","value":"max-age=31536000, public"},{"name":"Accept-Ranges","value":"bytes"},{"name":"Keep-Alive","value":"timeout=10, max=47"},{"name":"X-Cache-Hits","value":"716708"}],"cookies":[],"content":{"size":1635,"mimeType":"application/x-shockwave-flash","compression":-50},"redirectURL":"","headersSize":506,"bodySize":1685},"cache":{},"timings":{"blocked":-1,"dns":-1,"connect":-1,"send":1,"wait":34,"receive":18,"ssl":-1},"pageref":"page_1"},{"startedDateTime":"2013-07-22T17:28:46.678Z","time":31,"request":{"method":"GET","url":"https://ssl.google-analytics.com/__utm.gif?utmwv=5.4.3&utms=1&utmn=1479089277&utmhn=github.com&utmcs=UTF-8&utmsr=1920x1080&utmvp=1729x575&utmsc=32-bit&utmul=en-us&utmje=1&utmfl=11.8%20r800&utmdt=browsermob-proxy%2Fsrc%2Fmain%2Fjava%2Forg%2Fbrowsermob%2Fcore%2Fhar%2FHarCookie.java%20at%20master%20%C2%B7%20webmetrics%2Fbrowsermob-proxy%20%C2%B7%20GitHub&utmhid=1298644497&utmr=-&utmp=%2Fwebmetrics%2Fbrowsermob-proxy%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fjava%2Forg%2Fbrowsermob%2Fcore%2Fhar%2FHarCookie.java&utmht=1374514126667&utmac=UA-3769691-2&utmcc=__utma%3D1.508454281.1374514127.1374514127.1374514127.1%3B%2B__utmz%3D1.1374514127.1.1.utmcsr%3D(direct)%7Cutmccn%3D(direct)%7Cutmcmd%3D(none)%3B&utmu=qB~","httpVersion":"HTTP/1.1","headers":[{"name":":host","value":"ssl.google-analytics.com"},{"name":"accept-encoding","value":"gzip,deflate,sdch"},{"name":"accept-language","value":"en-US,en;q=0.8"},{"name":"user-agent","value":"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36"},{"name":":path","value":"/__utm.gif?utmwv=5.4.3&utms=1&utmn=1479089277&utmhn=github.com&utmcs=UTF-8&utmsr=1920x1080&utmvp=1729x575&utmsc=32-bit&utmul=en-us&utmje=1&utmfl=11.8%20r800&utmdt=browsermob-proxy%2Fsrc%2Fmain%2Fjava%2Forg%2Fbrowsermob%2Fcore%2Fhar%2FHarCookie.java%20at%20master%20%C2%B7%20webmetrics%2Fbrowsermob-proxy%20%C2%B7%20GitHub&utmhid=1298644497&utmr=-&utmp=%2Fwebmetrics%2Fbrowsermob-proxy%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fjava%2Forg%2Fbrowsermob%2Fcore%2Fhar%2FHarCookie.java&utmht=1374514126667&utmac=UA-3769691-2&utmcc=__utma%3D1.508454281.1374514127.1374514127.1374514127.1%3B%2B__utmz%3D1.1374514127.1.1.utmcsr%3D(direct)%7Cutmccn%3D(direct)%7Cutmcmd%3D(none)%3B&utmu=qB~"},{"name":"accept","value":"image/webp,*/*;q=0.8"},{"name":":version","value":"HTTP/1.1"},{"name":"referer","value":"https://github.com/webmetrics/browsermob-proxy/blob/master/src/main/java/org/browsermob/core/har/HarCookie.java"},{"name":":scheme","value":"https"},{"name":":method","value":"GET"}],"queryString":[{"name":"utmwv","value":"5.4.3"},{"name":"utms","value":"1"},{"name":"utmn","value":"1479089277"},{"name":"utmhn","value":"github.com"},{"name":"utmcs","value":"UTF-8"},{"name":"utmsr","value":"1920x1080"},{"name":"utmvp","value":"1729x575"},{"name":"utmsc","value":"32-bit"},{"name":"utmul","value":"en-us"},{"name":"utmje","value":"1"},{"name":"utmfl","value":"11.8%20r800"},{"name":"utmdt","value":"browsermob-proxy%2Fsrc%2Fmain%2Fjava%2Forg%2Fbrowsermob%2Fcore%2Fhar%2FHarCookie.java%20at%20master%20%C2%B7%20webmetrics%2Fbrowsermob-proxy%20%C2%B7%20GitHub"},{"name":"utmhid","value":"1298644497"},{"name":"utmr","value":"-"},{"name":"utmp","value":"%2Fwebmetrics%2Fbrowsermob-proxy%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fjava%2Forg%2Fbrowsermob%2Fcore%2Fhar%2FHarCookie.java"},{"name":"utmht","value":"1374514126667"},{"name":"utmac","value":"UA-3769691-2"},{"name":"utmcc","value":"__utma%3D1.508454281.1374514127.1374514127.1374514127.1%3B%2B__utmz%3D1.1374514127.1.1.utmcsr%3D(direct)%7Cutmccn%3D(direct)%7Cutmcmd%3D(none)%3B"},{"name":"utmu","value":"qB~"}],"cookies":[],"headersSize":1820,"bodySize":0},"response":{"status":200,"statusText":"OK","httpVersion":"HTTP/1.1","headers":[{"name":"pragma","value":"no-cache"},{"name":"date","value":"Thu, 18 Jul 2013 13:27:13 GMT"},{"name":"x-content-type-options","value":"nosniff"},{"name":"last-modified","value":"Wed, 21 Jan 2004 19:51:30 GMT"},{"name":"server","value":"GFE/2.0"},{"name":"version","value":"HTTP/1.1"},{"name":"age","value":"360093"},{"name":"content-type","value":"image/gif"},{"name":"status","value":"200 OK"},{"name":"cache-control","value":"private, no-cache, no-cache=Set-Cookie, proxy-revalidate"},{"name":"content-length","value":"35"},{"name":"expires","value":"Wed, 19 Apr 2000 11:43:00 GMT"}],"cookies":[],"content":{"size":35,"mimeType":"image/gif","compression":411},"redirectURL":"","headersSize":376,"bodySize":-376},"cache":{},"timings":{"blocked":-1,"dns":-1,"connect":-1,"send":0,"wait":20,"receive":8,"ssl":-1},"pageref":"page_1"},{"startedDateTime":"2013-07-22T17:28:46.735Z","time":52,"request":{"method":"GET","url":"https://collector.githubapp.com/github/page_view?dimensions[page]=https%3A%2F%2Fgithub.com%2Fwebmetrics%2Fbrowsermob-proxy%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fjava%2Forg%2Fbrowsermob%2Fcore%2Fhar%2FHarCookie.java&dimensions[title]=browsermob-proxy%2Fsrc%2Fmain%2Fjava%2Forg%2Fbrowsermob%2Fcore%2Fhar%2FHarCookie.java%20at%20master%20%C2%B7%20webmetrics%2Fbrowsermob-proxy%20%C2%B7%20GitHub&dimensions[referrer]=&dimensions[user_agent]=Mozilla%2F5.0%20(Windows%20NT%206.1%3B%20WOW64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F28.0.1500.72%20Safari%2F537.36&dimensions[screen_resolution]=1920x1080&dimensions[pixel_ratio]=1&dimensions[browser_resolution]=1743x574&dimensions[timestamp]=1374514126733&dimensions[user_id]=1020542&dimensions[user_login]=webmetrics&dimensions[repository_id]=305067&dimensions[repository_nwo]=webmetrics%2Fbrowsermob-proxy&dimensions[repository_public]=true&dimensions[repository_is_fork]=false&dimensions[repository_network_root_id]=305067&dimensions[repository_network_root_nwo]=webmetrics%2Fbrowsermob-proxy&","httpVersion":"HTTP/1.1","headers":[{"name":"Accept","value":"image/webp,*/*;q=0.8"},{"name":"Connection","value":"keep-alive"},{"name":"Accept-Encoding","value":"gzip,deflate,sdch"},{"name":"Referer","value":"https://github.com/webmetrics/browsermob-proxy/blob/master/src/main/java/org/browsermob/core/har/HarCookie.java"},{"name":"Host","value":"collector.githubapp.com"},{"name":"Accept-Language","value":"en-US,en;q=0.8"},{"name":"User-Agent","value":"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36"}],"queryString":[{"name":"dimensions[page]","value":"https%3A%2F%2Fgithub.com%2Fwebmetrics%2Fbrowsermob-proxy%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fjava%2Forg%2Fbrowsermob%2Fcore%2Fhar%2FHarCookie.java"},{"name":"dimensions[title]","value":"browsermob-proxy%2Fsrc%2Fmain%2Fjava%2Forg%2Fbrowsermob%2Fcore%2Fhar%2FHarCookie.java%20at%20master%20%C2%B7%20webmetrics%2Fbrowsermob-proxy%20%C2%B7%20GitHub"},{"name":"dimensions[referrer]","value":""},{"name":"dimensions[user_agent]","value":"Mozilla%2F5.0%20(Windows%20NT%206.1%3B%20WOW64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F28.0.1500.72%20Safari%2F537.36"},{"name":"dimensions[screen_resolution]","value":"1920x1080"},{"name":"dimensions[pixel_ratio]","value":"1"},{"name":"dimensions[browser_resolution]","value":"1743x574"},{"name":"dimensions[timestamp]","value":"1374514126733"},{"name":"dimensions[user_id]","value":"1020542"},{"name":"dimensions[user_login]","value":"webmetrics"},{"name":"dimensions[repository_id]","value":"305067"},{"name":"dimensions[repository_nwo]","value":"webmetrics%2Fbrowsermob-proxy"},{"name":"dimensions[repository_public]","value":"true"},{"name":"dimensions[repository_is_fork]","value":"false"},{"name":"dimensions[repository_network_root_id]","value":"305067"},{"name":"dimensions[repository_network_root_nwo]","value":"webmetrics%2Fbrowsermob-proxy"},{"name":"","value":""}],"cookies":[],"headersSize":1437,"bodySize":0},"response":{"status":200,"statusText":"OK","httpVersion":"HTTP/1.1","headers":[{"name":"Pragma","value":"no-cache"},{"name":"Date","value":"Mon, 22 Jul 2013 17:28:46 GMT"},{"name":"Vary","value":"Accept-Encoding"},{"name":"X-Rack-Cache","value":"miss"},{"name":"Last-Modified","value":"Mon, 22 Jul 2013 17:28:46 GMT"},{"name":"Server","value":"GitHub.com"},{"name":"Transfer-Encoding","value":"chunked"},{"name":"Content-Type","value":"image/gif; charset=utf-8"},{"name":"Status","value":"200 OK"},{"name":"Cache-Control","value":"no-store, no-cache, must-revalidate, private"},{"name":"X-UA-Compatible","value":"IE=Edge,chrome=1"},{"name":"Connection","value":"keep-alive"},{"name":"X-Runtime","value":"0.009796"},{"name":"X-Request-Id","value":"653f7f31577866965decc849bf1a5952"},{"name":"Expires","value":"Sat, 25 Nov 2000 05:00:00 GMT"}],"cookies":[],"content":{"size":35,"mimeType":"image/gif","compression":-36},"redirectURL":"","headersSize":496,"bodySize":71},"cache":{},"timings":{"blocked":-1,"dns":-1,"connect":-1,"send":0,"wait":48,"receive":1,"ssl":-1},"pageref":"page_1"},{"startedDateTime":"2013-07-22T17:28:46.793Z","time":45,"request":{"method":"POST","url":"https://github.com/_stats","httpVersion":"HTTP/1.1","headers":[{"name":"Cookie","value":"logged_in=no; _gh_sess=BAh7BzoPc2Vzc2lvbl9pZCIlMGI3NzliYzFlMTMyOTVlNzQ3N2ZmZjExZGNjOTg0ODM6EF9jc3JmX3Rva2VuSSIxa3NVMEcvZ3Vvdnh1OHZNdnB3K09oMHk3WWplakQ3Q01GN09CczFWTzVSWT0GOgZFRg%3D%3D--fd07e039df7aa192ca4c56b82ab1e18985782d75; tz=America%2FNew_York; spy_repo=webmetrics%2Fbrowsermob-proxy; spy_repo_at=Mon%20Jul%2022%202013%2013%3A28%3A46%20GMT-0400%20(Eastern%20Daylight%20Time); tracker=direct; __utma=1.508454281.1374514127.1374514127.1374514127.1; __utmb=1.1.10.1374514127; __utmc=1; __utmz=1.1374514127.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)"},{"name":"Origin","value":"https://github.com"},{"name":"Accept-Encoding","value":"gzip,deflate,sdch"},{"name":"X-CSRF-Token","value":"ksU0G/guovxu8vMvpw+Oh0y7YjejD7CMF7OBs1VO5RY="},{"name":"Host","value":"github.com"},{"name":"Accept-Language","value":"en-US,en;q=0.8"},{"name":"User-Agent","value":"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36"},{"name":"Content-Type","value":"application/x-www-form-urlencoded; charset=UTF-8"},{"name":"Accept","value":"*/*;q=0.5, text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},{"name":"Referer","value":"https://github.com/webmetrics/browsermob-proxy/blob/master/src/main/java/org/browsermob/core/har/HarCookie.java"},{"name":"X-Requested-With","value":"XMLHttpRequest"},{"name":"Connection","value":"keep-alive"},{"name":"Content-Length","value":"819"}],"queryString":[],"cookies":[{"name":"logged_in","value":"no","expires":null,"httpOnly":false,"secure":false},{"name":"_gh_sess","value":"BAh7BzoPc2Vzc2lvbl9pZCIlMGI3NzliYzFlMTMyOTVlNzQ3N2ZmZjExZGNjOTg0ODM6EF9jc3JmX3Rva2VuSSIxa3NVMEcvZ3Vvdnh1OHZNdnB3K09oMHk3WWplakQ3Q01GN09CczFWTzVSWT0GOgZFRg%3D%3D--fd07e039df7aa192ca4c56b82ab1e18985782d75","expires":null,"httpOnly":false,"secure":false},{"name":"tz","value":"America%2FNew_York","expires":null,"httpOnly":false,"secure":false},{"name":"spy_repo","value":"webmetrics%2Fbrowsermob-proxy","expires":null,"httpOnly":false,"secure":false},{"name":"spy_repo_at","value":"Mon%20Jul%2022%202013%2013%3A28%3A46%20GMT-0400%20(Eastern%20Daylight%20Time)","expires":null,"httpOnly":false,"secure":false},{"name":"tracker","value":"direct","expires":null,"httpOnly":false,"secure":false},{"name":"__utma","value":"1.508454281.1374514127.1374514127.1374514127.1","expires":null,"httpOnly":false,"secure":false},{"name":"__utmb","value":"1.1.10.1374514127","expires":null,"httpOnly":false,"secure":false},{"name":"__utmc","value":"1","expires":null,"httpOnly":false,"secure":false},{"name":"__utmz","value":"1.1374514127.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)","expires":null,"httpOnly":false,"secure":false}],"headersSize":1264,"bodySize":819,"postData":{"mimeType":"application/x-www-form-urlencoded; charset=UTF-8","text":"timing%5BloadEventEnd%5D=1374514126787&timing%5BloadEventStart%5D=1374514126787&timing%5BdomComplete%5D=1374514126787&timing%5BdomContentLoadedEventEnd%5D=1374514126578&timing%5BdomContentLoadedEventStart%5D=1374514126461&timing%5BdomInteractive%5D=1374514126461&timing%5BdomLoading%5D=1374514125841&timing%5BresponseEnd%5D=1374514125842&timing%5BresponseStart%5D=1374514125826&timing%5BrequestStart%5D=1374514125705&timing%5BsecureConnectionStart%5D=1374514125635&timing%5BconnectEnd%5D=1374514125704&timing%5BconnectStart%5D=1374514125604&timing%5BdomainLookupEnd%5D=1374514125604&timing%5BdomainLookupStart%5D=1374514125604&timing%5BfetchStart%5D=1374514125597&timing%5BredirectEnd%5D=0&timing%5BredirectStart%5D=0&timing%5BunloadEventEnd%5D=0&timing%5BunloadEventStart%5D=0&timing%5BnavigationStart%5D=1374514125569","params":[{"name":"timing%5BloadEventEnd%5D","value":"1374514126787"},{"name":"timing%5BloadEventStart%5D","value":"1374514126787"},{"name":"timing%5BdomComplete%5D","value":"1374514126787"},{"name":"timing%5BdomContentLoadedEventEnd%5D","value":"1374514126578"},{"name":"timing%5BdomContentLoadedEventStart%5D","value":"1374514126461"},{"name":"timing%5BdomInteractive%5D","value":"1374514126461"},{"name":"timing%5BdomLoading%5D","value":"1374514125841"},{"name":"timing%5BresponseEnd%5D","value":"1374514125842"},{"name":"timing%5BresponseStart%5D","value":"1374514125826"},{"name":"timing%5BrequestStart%5D","value":"1374514125705"},{"name":"timing%5BsecureConnectionStart%5D","value":"1374514125635"},{"name":"timing%5BconnectEnd%5D","value":"1374514125704"},{"name":"timing%5BconnectStart%5D","value":"1374514125604"},{"name":"timing%5BdomainLookupEnd%5D","value":"1374514125604"},{"name":"timing%5BdomainLookupStart%5D","value":"1374514125604"},{"name":"timing%5BfetchStart%5D","value":"1374514125597"},{"name":"timing%5BredirectEnd%5D","value":"0"},{"name":"timing%5BredirectStart%5D","value":"0"},{"name":"timing%5BunloadEventEnd%5D","value":"0"},{"name":"timing%5BunloadEventStart%5D","value":"0"},{"name":"timing%5BnavigationStart%5D","value":"1374514125569"}]}},"response":{"status":200,"statusText":"OK","httpVersion":"HTTP/1.1","headers":[{"name":"X-Runtime","value":"4"},{"name":"Date","value":"Mon, 22 Jul 2013 17:28:46 GMT"},{"name":"Strict-Transport-Security","value":"max-age=2592000"},{"name":"Vary","value":"Accept-Encoding"},{"name":"Server","value":"GitHub.com"},{"name":"X-Frame-Options","value":"deny"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Status","value":"200 OK"},{"name":"Set-Cookie","value":"logged_in=no; domain=.github.com; path=/; expires=Fri, 22-Jul-2033 17:28:46 GMT; secure; HttpOnly"},{"name":"Set-Cookie","value":"dotcom_user=; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT"},{"name":"Set-Cookie","value":"_gh_sess=BAh7BzoPc2Vzc2lvbl9pZCIlMGI3NzliYzFlMTMyOTVlNzQ3N2ZmZjExZGNjOTg0ODM6EF9jc3JmX3Rva2VuSSIxa3NVMEcvZ3Vvdnh1OHZNdnB3K09oMHk3WWplakQ3Q01GN09CczFWTzVSWT0GOgZFRg%3D%3D--fd07e039df7aa192ca4c56b82ab1e18985782d75; path=/; expires=Sun, 01-Jan-2023 00:00:00 GMT; secure; HttpOnly"},{"name":"Cache-Control","value":"no-cache"},{"name":"Connection","value":"keep-alive"},{"name":"Content-Length","value":"1"}],"cookies":[{"name":"logged_in","value":"no","path":"/","domain":".github.com","expires":"2033-07-22T17:28:46.000Z","httpOnly":true,"secure":true},{"name":"dotcom_user","value":"","path":"/","expires":"1970-01-01T00:00:00.000Z","httpOnly":false,"secure":false},{"name":"_gh_sess","value":"BAh7BzoPc2Vzc2lvbl9pZCIlMGI3NzliYzFlMTMyOTVlNzQ3N2ZmZjExZGNjOTg0ODM6EF9jc3JmX3Rva2VuSSIxa3NVMEcvZ3Vvdnh1OHZNdnB3K09oMHk3WWplakQ3Q01GN09CczFWTzVSWT0GOgZFRg%3D%3D--fd07e039df7aa192ca4c56b82ab1e18985782d75","path":"/","expires":"2023-01-01T00:00:00.000Z","httpOnly":true,"secure":true}],"content":{"size":1,"mimeType":"text/html","compression":-25},"redirectURL":"","headersSize":778,"bodySize":26},"cache":{},"timings":{"blocked":-1,"dns":-1,"connect":-1,"send":1,"wait":42,"receive":1,"ssl":-1},"pageref":"page_1"}]}}

Below is the generated stack trace:

com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "secure" (class org.browsermob.core.har.HarCookie), not marked as ignorable (6 known properties: , "value", "domain", "httpOnly", "expires", "path", "name"])
 at [Source: java.io.BufferedInputStream@38beb946; line: 140, column: 29] (through reference chain: org.browsermob.core.har.Har["log"]->org.browsermob.core.har.HarLog["entries"]->org.browsermob.core.har.HarEntry["response"]->org.browsermob.core.har.HarResponse["cookies"]->org.browsermob.core.har.HarCookie["secure"])
    at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:79)
    at com.fasterxml.jackson.databind.DeserializationContext.reportUnknownProperty(DeserializationContext.java:568)
    at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:650)
    at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:830)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:310)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:112)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:226)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:203)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:23)
    at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:336)
    at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:89)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:290)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:112)
    at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:336)
    at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:89)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:290)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:112)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:226)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:203)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:23)
    at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:336)
    at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:89)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:290)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:112)
    at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:336)
    at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:89)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:290)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:112)
    at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:2580)
    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:1856)
    at UtilsTest.setup(UtilsTest.java:19)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

Some of the requests are failing on the current snapshot with NoHttpResponseException and SSLException

I am getting a lot of failed requests when testing against the the current master.
This includes multiple NoHttpResponseException and SSLException exceptions. Please see below.
Evything was working fine under 2.0-beta-9.

Output for "https://yes.co.il" request through a proxied Chrome:

[ro@aelia bin]$ ./browsermob-proxy --port 9090
INFO 08/29 07:14:14 n.s.u.i.d.DataBuild~ - No pattern available for 'Other'.
INFO 08/29 07:14:14 n.s.u.i.d.DataBuild~ - No pattern available for 'Personal computer'.
INFO 08/29 07:14:15 n.s.u.i.d.DataBuild~ - No pattern available for 'Personal computer'.
INFO 08/29 07:14:15 n.l.b.p.Main - Starting BrowserMob Proxy version 2.0-beta-10-SNAPSHOT
INFO 08/29 07:14:15 o.e.j.u.log - jetty-7.3.0.v20110203
INFO 08/29 07:14:15 o.e.j.u.log - started o.e.j.s.ServletContextHandler{/,null}
INFO 08/29 07:14:15 o.e.j.u.log - Started [email protected]:9090
INFO 08/29 07:14:29 n.l.b.p.j.h.HttpSer~ - Version Jetty/5.1.x
INFO 08/29 07:14:29 n.l.b.p.j.u.Contain~ - Started HttpContext[/,/]
INFO 08/29 07:14:29 n.l.b.p.j.h.SocketL~ - Started SocketListener on 0.0.0.0:9091
INFO 08/29 07:14:29 n.l.b.p.j.u.Contain~ - Started net.lightbody.bmp.proxy.jetty.jetty.Server@706c22bd
INFO 08/29 07:14:36 n.l.b.p.j.u.Credent~ - Checking Resource aliases
INFO 08/29 07:14:36 n.l.b.p.j.h.SocketL~ - Started SocketListener on 0.0.0.0:33210
INFO 08/29 07:14:37 n.l.b.p.j.h.SocketL~ - Started SocketListener on 0.0.0.0:33390
INFO 08/29 07:14:38 n.l.b.p.j.h.SocketL~ - Started SocketListener on 0.0.0.0:39688
INFO 08/29 07:14:38 n.l.b.p.j.h.SocketL~ - Started SocketListener on 0.0.0.0:45458
INFO 08/29 07:14:38 n.l.b.p.h.BrowserMo~ - org.apache.http.NoHttpResponseException: The target server failed to respond when requesting https://yes.cdnwiz.com/SiteCollectionImages/site%20icons/show_schedule_4gallery.jpg
INFO 08/29 07:14:38 n.l.b.p.h.BrowserMo~ - java.net.SocketException: Connection reset when requesting https://code.jquery.com/ui/1.10.3/jquery-ui.min.js
INFO 08/29 07:14:38 n.l.b.p.h.BrowserMo~ - org.apache.http.NoHttpResponseException: The target server failed to respond when requesting https://yes.cdnwiz.com/SiteCollectionImages/site%20icons/gift_4pic_gallery.jpg
INFO 08/29 07:14:39 n.l.b.p.h.BrowserMo~ - org.apache.http.NoHttpResponseException: The target server failed to respond when requesting https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
INFO 08/29 07:14:40 n.l.b.p.h.BrowserMo~ - org.apache.http.NoHttpResponseException: The target server failed to respond when requesting https://yes.cdnwiz.com/SiteCollectionImages/site%20icons/show_schedule_4gallery.jpg
INFO 08/29 07:14:40 n.l.b.p.h.BrowserMo~ - org.apache.http.NoHttpResponseException: The target server failed to respond when requesting https://yes.cdnwiz.com/SiteCollectionImages/site%20icons/gift_4pic_gallery.jpg
INFO 08/29 07:14:40 n.l.b.p.j.h.SocketL~ - Started SocketListener on 0.0.0.0:50188
INFO 08/29 07:14:40 n.l.b.p.j.h.SocketL~ - Started SocketListener on 0.0.0.0:34356
INFO 08/29 07:14:41 n.l.b.p.j.h.SocketL~ - Started SocketListener on 0.0.0.0:56799
INFO 08/29 07:14:41 n.l.b.p.h.BrowserMo~ - org.apache.http.NoHttpResponseException: The target server failed to respond when requesting https://www.googletagmanager.com/gtm.js?id=GTM-PC88HV
INFO 08/29 07:14:42 n.l.b.p.h.BrowserMo~ - javax.net.ssl.SSLException: Received fatal alert: unexpected_message when requesting https://my.nanorep.com/widget/scripts/embed.js?account=yes

NULL comments break compatibility with external HAR viewer

HARs generated with recent master updates in support of HAR spec 1.2, specifically pull request 11 and follow on change 30ff049, will raise validation errors when using the online HAR Viewer.

The tool does not like null comments, e.g.:

timings": {
    "blocked": 0,
    "dns": -1,
    "connect": 15,
    "send": 20,
    "wait": 38,
    "receive": 12,
    "ssl": -1,
    "comment": null
}

Looking at the spec samples, all comments are provide as empty strings, as opposed to null.

Now I don't know what should be valid (i.e empty string, blank, or the word "null"), but simply replacing occurrences of

"comment": null

with

"comment": ""

solves the issue.

java.net.UnknownHostException when ProxyServer has a upstream proxy and visit https url

I'm using selenium + browsermob to test a website (www.mysite.com). When visit this site, I need to use a upstream proxy ("myproxy:8080") or it will show "Server not found."

And here is my code:
@test
public void test() throws Exception {
ProxyServer proxyServer = new ProxyServer(5368);
proxyServer.start();
Map<String, String> map = new HashMap<String, String>();
map.put("httpProxy", "myproxy:8080");
proxyServer.setOptions(map);

FirefoxProfile profile = new FirefoxProfile();
Proxy seleniumProxy = new Proxy();
seleniumProxy.setHttpProxy("localhost:5368");
seleniumProxy.setSslProxy("localhost:5368");

DesiredCapabilities dc = DesiredCapabilities.firefox();
dc.setCapability(FirefoxDriver.PROFILE, profile);
dc.setCapability(CapabilityType.PROXY, seleniumProxy);

WebDriver driver = new FirefoxDriver(dc);
// http request can work fine
driver.get("http://www.mysite.com");
Thread.sleep(2000);
// cannot open https page
driver.get("https://www.mysite.com/login.html");
driver.quit();

proxyServer.stop();

}

http requests can work fine, but when visit https url like ("https://www.mysite.com/login.html"), it will throw exception:
java.net.UnknownHostException: www.mysite.com
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:894)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1286)
at java.net.InetAddress.getAllByName0(InetAddress.java:1239)
at java.net.InetAddress.getAllByName(InetAddress.java:1155)
at java.net.InetAddress.getAllByName(InetAddress.java:1091)
at java.net.InetAddress.getByName(InetAddress.java:1041)
at net.lightbody.bmp.proxy.jetty.util.InetAddrPort.(InetAddrPort.java:88)
at net.lightbody.bmp.proxy.selenium.SeleniumProxyHandler.handleConnect(SeleniumProxyHandler.java:455)
at net.lightbody.bmp.proxy.BrowserMobProxyHandler.handleConnect(BrowserMobProxyHandler.java:76)
at net.lightbody.bmp.proxy.selenium.SeleniumProxyHandler.handle(SeleniumProxyHandler.java:158)
at net.lightbody.bmp.proxy.jetty.http.HttpContext.handle(HttpContext.java:1509)
at net.lightbody.bmp.proxy.jetty.http.HttpContext.handle(HttpContext.java:1461)
at net.lightbody.bmp.proxy.jetty.http.HttpServer.service(HttpServer.java:892)
at net.lightbody.bmp.proxy.jetty.http.HttpConnection.service(HttpConnection.java:815)
at net.lightbody.bmp.proxy.jetty.http.HttpConnection.handleNext(HttpConnection.java:981)
at net.lightbody.bmp.proxy.jetty.http.HttpConnection.handle(HttpConnection.java:832)
at net.lightbody.bmp.proxy.jetty.http.SocketListener.handleConnection(SocketListener.java:245)
at net.lightbody.bmp.proxy.jetty.util.ThreadedServer.handle(ThreadedServer.java:357)
at net.lightbody.bmp.proxy.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:534)

Please help to have a look, thanks in advance.

get secure cookies

Hi,

great project.

I cant seem to get a hold of cookies that are secure.

Here's a unit test:

@test
public void testCookiesAreCapturedWhenRequested() throws IOException {

proxy.setCaptureContent(true);
proxy.newHar("Test");
BasicClientCookie cookie = new BasicClientCookie("foo", "bar");
cookie.setDomain("127.0.0.1");
cookie.setPath("/");
client.getCookieStore().addCookie(cookie);

for (int i=0; i<20; i++){
     cookie = new BasicClientCookie("foo" + i, "bar" + i);
     cookie.setDomain("127.0.0.1");
     cookie.setPath("/");
     cookie.setSecure(true);
     client.getCookieStore().addCookie(cookie);
}


// set the cookie on the server side
String body = IOUtils.readFully(client.execute(new HttpGet("http://127.0.0.1:8080/echo/")).getEntity().getContent());
System.out.println(body);

Har har = proxy.getHar();
HarEntry entry = har.getLog().getEntries().get(0);

System.out.println(entry.getRequest().getCookies().size());
HarCookie harCookie = entry.getRequest().getCookies().get(0);
Assert.assertEquals("foo", harCookie.getName());
Assert.assertEquals("bar", harCookie.getValue());

}
When cookie.setSecure(true):
Method: GET
Request Headers:
Host: 127.0.0.1:8080
User-Agent: Apache-HttpClient/4.2.3 (java 1.5)
Cookie: foo=bar
Cookie2: $Version=1
Connection: keep-alive

1

when cookie.setSecure(false):
Method: GET
Request Headers:
Host: 127.0.0.1:8080
User-Agent: Apache-HttpClient/4.2.3 (java 1.5)
Cookie: foo=bar; foo0=bar0; foo1=bar1; foo10=bar10; foo11=bar11; foo12=bar12; foo13=bar13; foo14=bar14; foo15=bar15; foo16=bar16; foo17=bar17; foo18=bar18; foo19=bar19; foo2=bar2; foo3=bar3; foo4=bar4; foo5=bar5; foo6=bar6; foo7=bar7; foo8=bar8; foo9=bar9
Cookie2: $Version=1
Connection: keep-alive

21

OutOfMemoryError: Java heap space

Hi,

I've downloaded latest release 9 zip from http://bmp.lightbody.net/ and followed the instructions for using BrowserMobProxy with Selenium.

Tests are executing remotely, so I've raised proxy (using batch from zip) on remote VM. Everything works perfect except cases with capturing big files content (e.g. 50Mb). In such situation I'm getting out of memory exception.

I've tried to set EXTRA_JVM_ARGUMENTS=-Xmx128m in batch file. No luck. I've also increased system java heap size, run hub / nodes with Xms arg, executed sources with this option - the same exception.

Any ideas?

Thanks,
Sergey

Support for RemoteWebDriver

Hi,

First of all thank you for this wonderful tool and great job.

I just need to know if there is anyway to support RemoteWebDriver because right now. I can add the proxy capability to a RemoteWebDriver. But I cannot seem to get the har file or requests. Is this not yet implemented? Or is this impossible to do so?

Thanks,
Christopher

POST data params missing - ClonedInputStream problem

For some POST requests, the POST params do not appear. The problem happens here:

BrowserMobHttpClient.java (line 715):
final String content = new String(req.getCopy().toByteArray(), "UTF-8");

At this point, req.getCopy() is empty, again only for SOME post requests, I'm not sure what triggers it. If I debug and try to read the input stream at this point, the data is actually there, but it is just not getting populated into the copy. After I do this during my debug session...

IOUtils.toString(req.getInputStreamEntity().getContent())

...the copy seems to be populated with data, and everything works correctly.

Tests hang on

When execute mvn -Prelease install tests hang on:

Running net.lightbody.bmp.proxy.SslTest
INFO 08/02 20:03:13 n.l.b.p.j.h.HttpSer~ - Version Jetty/5.1.x
INFO 08/02 20:03:13 n.l.b.p.j.u.Contain~ - Started HttpContext[/,/]
INFO 08/02 20:03:13 n.l.b.p.j.h.SocketL~ - Started SocketListener on 0.0.0.0:8081
INFO 08/02 20:03:13 n.l.b.p.j.u.Contain~ - Started net.lightbody.bmp.proxy.jetty.jetty.Server@1a618a48
INFO 08/02 20:03:13 n.l.b.p.j.h.SocketL~ - Started SocketListener on 0.0.0.0:34900
INFO 08/02 20:03:13 n.l.b.p.j.u.Threade~ - Stopping Acceptor [SSL: ServerSocket[addr=0.0.0.0/0.0.0.0,localport=34900]]
INFO 08/02 20:03:13 n.l.b.p.h.BrowserMo~ - org.apache.http.NoHttpResponseException: The target server failed to respond when requesting https://www.google.ca/
INFO 08/02 20:03:13 n.l.b.p.j.h.SocketL~ - Stopped SocketListener on 0.0.0.0:34900
INFO 08/02 20:03:13 n.l.b.p.j.u.Threade~ - Stopping Acceptor ServerSocket[addr=/0.0.0.0,localport=8081]
INFO 08/02 20:03:13 n.l.b.p.j.h.SocketL~ - Stopped SocketListener on 0.0.0.0:8081
INFO 08/02 20:03:14 n.l.b.p.j.u.Contain~ - Stopped HttpContext[/,/]
INFO 08/02 20:03:14 n.l.b.p.j.u.Contain~ - Stopped net.lightbody.bmp.proxy.jetty.jetty.Server@1a618a48
INFO 08/02 20:03:14 n.l.b.p.j.h.HttpSer~ - Version Jetty/5.1.x
INFO 08/02 20:03:14 n.l.b.p.j.u.Contain~ - Started HttpContext[/,/]
INFO 08/02 20:03:14 n.l.b.p.j.h.SocketL~ - Started SocketListener on 0.0.0.0:8081
INFO 08/02 20:03:14 n.l.b.p.j.u.Contain~ - Started net.lightbody.bmp.proxy.jetty.jetty.Server@1e43329e
INFO 08/02 20:03:14 n.l.b.p.j.h.SocketL~ - Started SocketListener on 0.0.0.0:35721
INFO 08/02 20:03:14 n.l.b.p.j.u.Threade~ - Stopping Acceptor [SSL: ServerSocket[addr=0.0.0.0/0.0.0.0,localport=35721]]
INFO 08/02 20:03:14 n.l.b.p.h.BrowserMo~ - javax.net.ssl.SSLException: Received fatal alert: unexpected_message when requesting https://www.fidelity.com/
INFO 08/02 20:03:14 n.l.b.p.j.h.SocketL~ - Stopped SocketListener on 0.0.0.0:35721
INFO 08/02 20:03:14 n.l.b.p.j.u.Threade~ - Stopping Acceptor ServerSocket[addr=/0.0.0.0,localport=8081]
INFO 08/02 20:03:14 n.l.b.p.j.h.SocketL~ - Stopped SocketListener on 0.0.0.0:8081
INFO 08/02 20:03:14 n.l.b.p.j.u.Contain~ - Stopped HttpContext[/,/]
INFO 08/02 20:03:14 n.l.b.p.j.u.Contain~ - Stopped net.lightbody.bmp.proxy.jetty.jetty.Server@1e43329e
INFO 08/02 20:03:14 n.l.b.p.j.h.HttpSer~ - Version Jetty/5.1.x
INFO 08/02 20:03:14 n.l.b.p.j.u.Contain~ - Started HttpContext[/,/]
INFO 08/02 20:03:14 n.l.b.p.j.h.SocketL~ - Started SocketListener on 0.0.0.0:8081
INFO 08/02 20:03:14 n.l.b.p.j.u.Contain~ - Started net.lightbody.bmp.proxy.jetty.jetty.Server@3486113d
INFO 08/02 20:03:15 n.l.b.p.j.h.SocketL~ - Started SocketListener on 0.0.0.0:50819
INFO 08/02 20:03:15 n.l.b.p.j.u.Threade~ - Stopping Acceptor [SSL: ServerSocket[addr=0.0.0.0/0.0.0.0,localport=50819]]
INFO 08/02 20:03:15 n.l.b.p.h.BrowserMo~ - javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure when requesting https://login.salesfo$
ce.com/
INFO 08/02 20:03:15 n.l.b.p.j.h.SocketL~ - Stopped SocketListener on 0.0.0.0:50819
INFO 08/02 20:03:15 n.l.b.p.j.u.Threade~ - Stopping Acceptor ServerSocket[addr=/0.0.0.0,localport=8081]
INFO 08/02 20:03:15 n.l.b.p.j.h.SocketL~ - Stopped SocketListener on 0.0.0.0:8081
INFO 08/02 20:03:15 n.l.b.p.j.u.Contain~ - Stopped HttpContext[/,/]
INFO 08/02 20:03:15 n.l.b.p.j.u.Contain~ - Stopped net.lightbody.bmp.proxy.jetty.jetty.Server@3486113d
INFO 08/02 20:03:15 n.l.b.p.j.h.HttpSer~ - Version Jetty/5.1.x
INFO 08/02 20:03:15 n.l.b.p.j.u.Contain~ - Started HttpContext[/,/]
INFO 08/02 20:03:15 n.l.b.p.j.h.SocketL~ - Started SocketListener on 0.0.0.0:8081
INFO 08/02 20:03:15 n.l.b.p.j.u.Contain~ - Started net.lightbody.bmp.proxy.jetty.jetty.Server@28d0a524
INFO 08/02 20:03:15 n.l.b.p.j.h.SocketL~ - Started SocketListener on 0.0.0.0:41064
INFO 08/02 20:03:16 n.l.b.p.j.h.SocketL~ - Started SocketListener on 0.0.0.0:33445

and i pass -DskipTests to workaround it.

Setting up simple dependency - proxy results in HTTP 403 Error

Following the documentation steps, after adding the dependency:

"Once done, you can start a proxy using net.lightbody.bmp.proxy.ProxyServer:

ProxyServer server = new ProxyServer(9090);
server.start();"

Results in a 403 Forbidden for Proxy error when either doing POST's via curl or hitting the localhost:[port] in a browser.

NPE when deleting proxy

INFO 08/04 08:26:30 n.l.b.p.j.u.Threade~ - Stopping Acceptor ServerSocket[addr=/0.0.0.0,port=0,localport=9092]
WARN 08/04 08:26:30 o.e.j.u.log          - /proxy/9092
com.google.sitebricks.routing.EventDispatchException: Exception [NullPointerException - "null"] thrown by event method [public com.google.sitebricks.headless.Reply net.lightbody.bmp.proxy.bricks.ProxyResource.delete(int) throws java.lang.Exception]
at net.lightbody.bmp.proxy.ProxyManager.delete(ProxyManager.java:68)
(See below for entire trace.)

at com.google.sitebricks.routing.DefaultPageBook$MethodTuple.call(DefaultPageBook.java:678)
at com.google.sitebricks.routing.DefaultPageBook$MethodTuple.call(DefaultPageBook.java:665)
at com.google.sitebricks.routing.DefaultPageBook$PageTuple.callAction(DefaultPageBook.java:544)
at com.google.sitebricks.routing.DefaultPageBook$PageTuple.doMethod(DefaultPageBook.java:528)
at com.google.sitebricks.routing.WidgetRoutingDispatcher.fireEvent(WidgetRoutingDispatcher.java:137)
at com.google.sitebricks.routing.WidgetRoutingDispatcher.bindAndReply(WidgetRoutingDispatcher.java:90)
at com.google.sitebricks.routing.WidgetRoutingDispatcher.dispatch(WidgetRoutingDispatcher.java:73)
at com.google.sitebricks.DebugModeRoutingDispatcher.dispatch(DebugModeRoutingDispatcher.java:63)
at com.google.sitebricks.SitebricksFilter.doFilter(SitebricksFilter.java:41)
at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
at com.google.sitebricks.HiddenMethodFilter.doFilter(HiddenMethodFilter.java:74)
at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1323)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:474)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:224)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:935)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:404)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:184)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:870)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:346)
at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:596)
at org.eclipse.jetty.server.HttpConnection$RequestHandler.messageComplete(HttpConnection.java:1084)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:846)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:220)
at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:426)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:520)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:528)
at java.lang.Thread.run(Thread.java:695)

Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.sitebricks.routing.DefaultPageBook$MethodTuple.call(DefaultPageBook.java:671)
... 34 more

Caused by: java.lang.NullPointerException
at net.lightbody.bmp.proxy.ProxyManager.delete(ProxyManager.java:68)
at net.lightbody.bmp.proxy.bricks.ProxyResource.delete(ProxyResource.java:377)
... 39 more
INFO 08/04 08:26:30 n.l.b.p.j.h.SocketL~ - Stopped SocketListener on 0.0.0.0:9092
INFO 08/04 08:26:30 n.l.b.p.j.u.Contain~ - Stopped HttpContext[/,/]
INFO 08/04 08:26:30 n.l.b.p.j.u.Contain~ - Stopped net.lightbody.bmp.proxy.jetty.jetty.Server@c566b3e

I am not sure how to reproduce it, though it happens from time to time.

Cannot access the proxy server on embedded mode

Hi,

When using embedded mode I cant seem to access the proxy server. It throws Http Error 403 Forbidden. Is this a limitation in embedded mode? The reason I need this is that I am using a remote webdriver and I need to use the proxy server that the embedded mode created to be used remotely.

Using "localhost" in brower proxy configuration no longer works

Issue with recent getLocalHost() tweak.

In my usecase, a test browser and BMP instance are running on the same host. So, in the Firefox proxy configuration, the proxy was set to "localhost". Prior this code change, the proxy would start "SocketListener on 0.0.0.0:XXXX" and telling Firefox to use "localhost" as the proxy would work just fine. Specifying the actual IP would also work for either a local or remote browser.

However, with the code change, the proxy starts a "SocketListener on X.X.X.X:XXXX". So telling Firefox to use "localhost" no longer works.

Looking at the commit history, seems this change was made in support of binding the proxy to alternative host addresses.

Off the top of your head, could the old behavior continue to be maintained while still providing the updated functionality?

Is this a usecase that should be supported? deprecated?

startedDateTime not compliant with HAR 1.2 ?

According to the HAR 1.2 spec, startedDateTime field format should be ISO 8601 - YYYY-MM-DDThh:mm:ss.sTZD

Using the Har with Google Page Speed, I encountered an issue on JSON parsing, and I saw that my fields are on this format :
"startedDateTime": "2013-11-05T22:21:10.747+0100"
But, if I read correctly the HAR spec, it should be 2013-11-05T22:21:10.747+01:00
(TZD = time zone designator (Z or +hh:mm or -hh:mm) according to http://www.w3.org/TR/NOTE-datetime)

Browsing proxy sources, I discovered the ISO8601DateFormatter, but I don't exactly understand the line 24 :
DateFormat df = (DateFormat) provider.getConfig().getDateFormat().clone();

The provider config does not seem to be set anywhere in the project, so I assume it's a Jackson default one.

I look here and on the web for similar issues, but without results.

Has someone ever had this issue ?
I first wanted to update the dateformat used in ISO8601DateFormatter, but this formatter is used for several fields, so I think it could be better to create a new one, only used for fields with the same spec : startedDateTime & cookies.expires

Conflict for Base64 import in Java8

There is a conflict between net.lightbody.bmp.proxy.util.Base64 and java.util.Base64. An explicit import will solve this error. Making an PR for the same.

Missed version in beta 9

I've downloaded the latests binary (beta 9) and got the following message on proxy start:
INFO 07/03 09:42:08 n.l.b.p.Main - Starting BrowserMob Proxy version %s
i run it on macos

Update Jetty (and other dependencies) to the latest version

This product looks really great but I can't use it because of many dependency conflicts. For example, you are still using Jetty 7 while the product I'm working on has Jetty 9.

It would be great if the product would be split-up into a jar that is only for embedded Java and a jar that also allows the web access. This way, the amount of (unused) dependencies you import when running in embedded Java mode will be significantly reduced.

"Server not found" if hostname contains an underscore

Example:

#!/usr/bin/python

from selenium import webdriver
from browsermobproxy import Server

server = Server("browsermob-proxy/bin/browsermob-proxy")
server.start()
proxy = server.create_proxy()

profile = webdriver.FirefoxProfile()
profile.set_proxy(proxy.selenium_proxy())
driver = webdriver.Firefox(firefox_profile=profile)

driver.get("http://trueblood_tv.livejournal.com/")

Note that http://trueblood_tv.livejournal.com/ exists and opens just fine in Selenium if BrowserMob Proxy is not used.

This is a major issue for me because my company uses underscores in its test domains.

Proxy server not working in version 2.0-beta-9

I've been trying to update to 2.0-beta-9.
I've updated my maven dependency to 2.0-beta-9, but once I do that, in my tests I get "Proxy Server is refusing connections" for firefox and chrome.

I've tried debugging the issue (put some breakpoints in execute functions), but it seems that it doesn't even get there.
Reverting to 2.0-beta-8 makes tests work again.
Any idea what could be going on?

HAR's content.encoding is not set for base64-encoded content

Hi,

HAR 1.2 added an encoding attribute to the content object, which can be used to indicate whether the content is base64-encoded. browsermob-proxy's HarContent class supports this field, but I was surprised to see that it's never being used.

Perhaps this could be fixed by adding another line to BrowserMobHttpClient.setBinaryContentOfEntry() to do something like entry.getResponse().getContent().setEncoding("base64")?

Thanks,
David

HTTPS support

Does bmp support HTTPS traffic, if not is it on the road map of the development.

Use InetAddress.getByName(String host)

Just wondering why you don't use InetAddress.getByName(String host) in BrowserMobHostNameResolver.java?

I've run into a problem - I've got a bunch of testing hosts defined in my /etc/hosts file but every time I run JBehave with browsermob-proxy it fails with an UnknownHostException - the reason is that dnsjava (which BrowserMobHostNameResolver.java appears to use classes from) doesn't respect the hosts file.

InetAddress.getByName(String host) on the other hand does, so could you add it as another strategy to resolve the IP address of the host?

reading POST data from RequestInterceptor causes data to be removed from original request

I have posted this in Google groups and in the older GitHub project before the recent fork. Basically, it seems that reading any POST parameters inside a RequestInterceptor will cause all of the POST data from the original request to drop from the request.

I now know that this is a known issue with the part of the proxy code, and i am willing to put in some time to try and fix it if i can, if i am pointed at the area of the code where this needs to be changed, i can take a shot at trying to wrap the outputstream correctly so that reading the POST parameters doesn't break the proxy request.

Below is my original post from the google group:

Hi all,

I've been using Browsermob-proxy and Selenium Webdriver for a few months now to run some simple tests and get more acquainted with browser automation testing and performance data gathering.

recently, i have started to experiment with the RequestInterceptor. I've created my own class that implements it, and everything seems to work fine. However, i have noticed that if I ever attempt to even READ what the post parameters are, it causes my browser test to stop, and FireFox (which i use primarily for testing) will display the "Oops!, Something went wrong. Firefox can't seem to load the page for some reason" message in the browser and in my console output window, i see an exception (java.net.SocketTimeoutException) thrown from the browsermob process.

It doesn't seem to matter what the POST data contains, but the test i've been using lately is on www.walmart.com. I have a very basic script that just goes to www.walmart.com, clicks on the sign in link, signs in, and then verifies that the user name is on the screen. This actually works flawlessly pretty much 100% of the time by itself, but as soon as I try and inspect the POST request that actually performs this login procedure, i see this error. It doesn;t matter if teh username and password are valid or not either, it simply seems to corrupt the request just by trying to get what the value of a parameter is.

Here is the entire contents of my request interceptor code:

import net.lightbody.bmp.proxy.http.BrowserMobHttpRequest;
import net.lightbody.bmp.proxy.http.RequestInterceptor;

public class ProxyRequestInterceptor implements RequestInterceptor
{
    public void process(BrowserMobHttpRequest request)
    {
        String testParam;
        testParam = request.getProxyRequest().getParameter("userName");

        System.out.println("Intercepted Request to: " + request.getProxyRequest().getRequestLine());
        if (testParam != null) System.out.println("TestParam: " + testParam );
    }
}

When I run my test with this code as is, going to walmart.com and logging in, when the test script gets to the point where it actually initiates the login request, I will actually see the parameter printed to the console, just as I am trying to do here...but then the socket timeout happens.

During my test, I am capturing both headers and content in a Har and dumping the entire thing to a text file every time I run the test. What I found was that on this POST request, the status code that comes back is -998 and in the "postData" object for this request, under "params" is just an empty "name": entry, and all of the actual POST data is missing.

Am I doing something wrong? In the future, I would really like to be able to not only capture this data, but also modify it as well, changing values like this before they are sent along to the server. I also have a ResponseInterceptor in this project, and I find that there I can see these values with no issue, but I'd really like to be able to see them (and possibly modify them) on the way out as well.

Thanks in advance to anyone who can help shine some light on this for me.

Can't set headers

curl -X POST --data '{ "User-Agent": "iPhone" }' http://localhost:8080/proxy/8080/headers --header "Content-Type:application/json"

<body>
<h2>HTTP ERROR: 500</h2>
<p>Problem accessing /proxy/8080/headers. Reason:
<pre>    Exception [NullPointerException - "null"] thrown by event method [public com.google.sitebricks.headless.Reply net.lightbody.bmp.proxy.bricks.ProxyResource.updateHeaders(int,com.google.sitebricks.headless.Request)]

oh boy

WARN 09/05 19:31:36 o.e.j.u.log          - /proxy/8080/headers
com.google.sitebricks.routing.EventDispatchException: Exception [NullPointerException - "null"] thrown by event method [public com.google.sitebricks.headless.Reply net.lightbody.bmp.proxy.bricks.ProxyResource.updateHeaders(int,com.google.sitebricks.headless.Request)]

at net.lightbody.bmp.proxy.bricks.ProxyResource.updateHeaders(ProxyResource.java:149)
(See below for entire trace.)

    at com.google.sitebricks.routing.DefaultPageBook$MethodTuple.call(DefaultPageBook.java:678)
    at com.google.sitebricks.routing.DefaultPageBook$MethodTuple.call(DefaultPageBook.java:665)
    at com.google.sitebricks.routing.DefaultPageBook$PageTuple.callAction(DefaultPageBook.java:544)
    at com.google.sitebricks.routing.DefaultPageBook$PageTuple.doMethod(DefaultPageBook.java:528)
    at com.google.sitebricks.routing.WidgetRoutingDispatcher.fireEvent(WidgetRoutingDispatcher.java:137)
    at com.google.sitebricks.routing.WidgetRoutingDispatcher.bindAndReply(WidgetRoutingDispatcher.java:90)
    at com.google.sitebricks.routing.WidgetRoutingDispatcher.dispatch(WidgetRoutingDispatcher.java:73)
    at com.google.sitebricks.DebugModeRoutingDispatcher.dispatch(DebugModeRoutingDispatcher.java:63)
    at com.google.sitebricks.SitebricksFilter.doFilter(SitebricksFilter.java:41)
    at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
    at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
    at com.google.sitebricks.HiddenMethodFilter.doFilter(HiddenMethodFilter.java:74)
    at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
    at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
    at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
    at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1323)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:474)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:224)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:935)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:404)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:184)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:870)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    at org.eclipse.jetty.server.Server.handle(Server.java:346)
    at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:596)
    at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1068)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:807)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:220)
    at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:426)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:520)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:528)
    at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.google.sitebricks.routing.DefaultPageBook$MethodTuple.call(DefaultPageBook.java:671)
    ... 34 more
Caused by: java.lang.NullPointerException
    at net.lightbody.bmp.proxy.bricks.ProxyResource.updateHeaders(ProxyResource.java:149)
    ... 39 more

unable to proxy HTTPS traffic (using Firefox remote webdriver, BMP2.0-beta8)

Hi Patrick,
I am trying to use the MBP with selenium(java) anagrammatically, Everything works like a charm for HTTP but for HTTPS i get the error below, unable to get it to work. I installed the needed certificate and made sure set selenium to trust all certs etc. I am confused about how BMP uses the same proxy port for HTTP and HTTPS? is this right or am i doing something wrong.

INFO 10/23 20:02:24 n.l.b.p.j.h.HttpSer~ - Version Jetty/5.1.x
INFO 10/23 20:02:24 n.l.b.p.j.u.Contain~ - Started HttpContext[/,/]
INFO 10/23 20:02:24 n.l.b.p.j.h.SocketL~ - Started SocketListener on 0.0.0.0:9091
INFO 10/23 20:02:24 n.l.b.p.j.u.Contain~ - Started net.lightbody.bmp.proxy.jetty.jetty.Server@6c7779d2
2013-10-23 16:02:24 INFO SeleniumUtils:60 - Started Proxy Server on port:9091
2013-10-23 16:02:24 INFO SeleniumUtils:152 - yow-lp1ow.kendall.corp.akamai.com:9091
2013-10-23 16:02:26 INFO SeleniumUtils:172 - instantiated remote webdriver
2013-10-23 16:02:26 INFO SeleniumUtils:290 - Removing no-transform header
INFO 10/23 20:02:30 n.l.b.p.j.u.Credent~ - Checking Resource aliases
INFO 10/23 20:02:30 n.l.b.p.j.h.SocketL~ - Started SocketListener on 0.0.0.0:45364
INFO 10/23 20:02:31 n.l.b.p.h.BrowserMo~ - javax.net.ssl.SSLException: Received fatal alert: unexpected_message when requesting https://www.mbok.jp/
2013-10-23 16:02:31 INFO SeleniumUtils:575 - page is transformed ?false
INFO 10/23 20:02:31 n.l.b.p.h.BrowserMo~ - javax.net.ssl.SSLException: Received fatal alert: unexpected_message when requesting https://www.mbok.jp/favicon.ico

my code:
proxy = new ProxyServer(Integer.valueOf(ConfigurationManager.getConfigs().getProperty("proxyPort")).intValue());

        proxy.start();
        log.info("Started Proxy Server on port:" + proxy.getPort());
        proxy.clearDNSCache();

DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setJavascriptEnabled(true);
capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
//capabilities.setPlatform(Platform.WINDOWS);

    Proxy proxy = getBroserMobProxyServer(remap).seleniumProxy();
    log.info(proxy.getHttpProxy());
    setProxyIPs(proxy);

    FirefoxProfile profile = new FirefoxProfile();
    profile.setAcceptUntrustedCertificates(true);
    profile.setAssumeUntrustedCertificateIssuer(true);
    profile.setPreference("network.proxy.http_port", Integer.valueOf(ConfigurationManager.getConfigs().getProperty("proxyPort")).intValue());
    profile.setPreference("network.proxy.type", 1);
    profile.setPreference("network.proxy.share_proxy_settings", true);
    capabilities.setCapability(FirefoxDriver.PROFILE, profile);
    capabilities.setCapability(CapabilityType.PROXY, proxy);

    try {

        log.debug("instantiating remote webdriver");
        String gridIP = ConfigurationManager.getConfigs().getProperty(
                "seleniiumGridIPAndPort");
        fireFoxdriver = new RemoteWebDriver(new URL("http://" + gridIP
                + "/wd/hub"), capabilities);

        log.info("instantiated remote webdriver");

    //fireFoxdriver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
    fireFoxdriver.manage().window().maximize();
    //fireFoxdriver.manage().window().setSize(new Dimension(1024, 768));

UnknownHostException

Hi,

I am testing on Mac OS and for some reason I get UnknownHostException on an intranet server (server connected via vpn). Local and external servers are Ok. I am using embedded mode.

I assume that the issue is because BMP doesn't use /etc/resolv.conf for DNS lookup. And so I tried using /etc/hosts but it also won't work. Can we have a feature to include DNS lookup using DNS servers? Or atleast use /etc/hosts for remapping.

Thanks,
Christopher

HAR file Validation error while creating using REST CURL requests

Hi,

After Creating Proxy using a server and generating a HAR file it is working fine through CURL requests but while viewing HAR it is throwing a HAR Validation Error as

Sum of request timings doesn't correspond to the total value: http://google.co.in (request.time: 357 vs. sum: 694), request#: 0, parent page: Foo

After going through the issue I came to know that while calculating the total time it is not using the blocked time for calculating SUM.

As per http://www.softwareishard.com/blog/har-12-spec/
entry.time == entry.timings.blocked + entry.timings.dns +
entry.timings.connect + entry.timings.send + entry.timings.wait +
entry.timings.receive;

but the generated HAR not summing up the blocked time, As per my understanding

Can't add response header using JavaScript

I'm attempting to add a header to the response returned to the browser via JavaScript but it is not having any impact:

curl -X POST -H 'Content-Type: text/plain' -d 'response.getRawResponse().addHeader("Moo", "1");' http://browsermob:8080/proxy/9099/interceptor/response
curl -k -x browsermob:9099 http://www.example.com/ -D -  -o /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0HTTP/1.1 200 OK
Date: Wed, 23 Apr 2014 17:01:51 GMT
Server: Jetty/5.1.x (Windows Server 2012/6.2 amd64 java/1.7.0_21
Accept-Ranges: bytes
Cache-Control: max-age=604800
Content-Type: text/html
Date: Wed, 23 Apr 2014 17:01:51 GMT
ETag: "359670651"
Expires: Wed, 30 Apr 2014 17:01:51 GMT
Last-Modified: Fri, 09 Aug 2013 23:54:35 GMT
Server: ECS (iad/19AB)
X-Cache: HIT
x-ec-custom-error: 1
Content-Length: 1270

100  1270  100  1270    0     0   7214      0 --:--:-- --:--:-- --:--:--  7257

Unable to set network interface to use for ProxyServer

I connect to a test network over VPN, but the proxy server uses my ethernet interface rather than VPN interface for creating sockets. This means that the test browsers are unable to see the Selenium proxy I create. It would be useful to have the interface name to use as a configurable parameter on the ProxyServer object.

SSL resources loading broken in eclipse

There is a couple of resources in the project classpath, mainly some ssl stuff under the sslSupport package. Those resources are loaded with the ResouceExtractor helper. As long as we are in the simple app that does not uses custom classloaders this works fine. However that does not work any longer in environments like Eclipse where we've got custom classloaders and deal with the custom URLs schemas like "bundleresource://". It would be nice if we allow users to resolve those URLs in the way they need.

In a short words: ssl does not work when bmp is kept in an eclipse plugin

https websites using BrowserMob proxy with Selenium does not work

I was trying to use the code in the section "Using with Selenium" posted on https://github.com/lightbody/browsermob-proxy to load any https website (https://www.yahoo.com) on my Mac. I see an error message like this "
Oops.

Something went wrong.

Firefox can't load this page for some reason.
"

On the console I get an error message as seen below:

INFO: javax.net.ssl.SSLHandshakeException: Received fatal alert: unrecognized_name when requesting https://www.yahoo.com/
Aug 03, 2014 10:55:23 PM net.lightbody.bmp.proxy.util.Log info
INFO: javax.net.ssl.SSLHandshakeException: Received fatal alert: unrecognized_name when requesting https://www.yahoo.com/favicon.ico
Aug 03, 2014 10:55:24 PM net.lightbody.bmp.proxy.util.Log info
INFO: javax.net.ssl.SSLHandshakeException: Received fatal alert: unrecognized_name when requesting https://www.yahoo.com/favicon.ico

How to use Browsermob's Javascript request/response interceptors

I try to use Browsermob's Javascript request interceptor API.

I started a Browsermob server at port 3000 (with proxy port set to 9091) and made a POST request:

curl -X POST -d 'request.getMethod().removeHeaders("User-Agent");' http://localhost:3000/proxy/9091/interceptor/request

And I received the following response:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 500 Binding expression (request/form parameter) contained invalid characters: request.getMethod().removeHeaders("User-Agent");</title>
</head>
<body>
<h2>HTTP ERROR: 500</h2>
<p>Problem accessing /proxy/9091/interceptor/request. Reason:
<pre>    Binding expression (request/form parameter) contained invalid characters: request.getMethod().removeHeaders("User-Agent");</pre></p>
<hr /><i><small>Powered by Jetty://</small></i>
</body>
</html>

What I did wrong? How can I use Javascript request interceptor?

I asked this question in Browsermob's forum and Stack Overflow but I haven't got response there.

PhantomJSTest.java: Unable to Find element with id 'p_13838465-p'

I am finding that elements are not being found when running browsermob-proxy 2.0-beta-9 with PhantomJSDriver 1.1.0 and Selenium 2.37.1.

I was also able to confirm this locally by adding driver.findElement(By.id("p_13838465-p")); after line 57 in src/test/java/net/lightbody/bmp/proxy/PhantomJSTest.java and rerunning the unit test.

I ended up getting a Unable to Find element with id 'p_13838465-p' error.

Invalid URL escaping

BMP does its own URL escaping and seems to be very aggressive about it. There's a reference to a JIRA issue, but it's for a tracker I don't think anyone has access to any longer. And the comment seems a bit out of date:

https://github.com/lightbody/browsermob-proxy/blob/browsermob-proxy-2.0-beta-9/src/main/java/net/lightbody/bmp/proxy/http/BrowserMobHttpClient.java#L324-L338

I just ran into a problem where that bit of code converted a "~" in the URL path to "%7E". CloudFront apparently does an exact match and determined the encoded URL wasn't the same and sent me back a 404.

I can fix this easily enough, but since this was deliberately added I didn't want to blindly change it. A couple questions I have are:

  • Why are these characters specially handled?
  • Why not use a standard URL escape utility?
  • Since the common use case is requests from browsers, can't we trust them to send properly encoded URLs?

Thread Pool throws npe

Haven't a chance to look into this yet, will dig in more later, but the thread pool seems to throw an npe.

Exception in thread "SocketListener8-87" java.lang.NullPointerException
at net.lightbody.bmp.proxy.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:536)

With my tests im running 10 proxies all using har capture, is this beyond supported load, or are there suggested jvm settings to run under?

Thanks,
Jason

ProxyServer class should try to find a free port by itself if nothing is specified

On our build server it would be handy if browsermob finds a free port by itself.
Since we are using the public org.openqa.selenium.Proxy seleniumProxy()-Method we are not dealing with the chosen port anyway.

I think thats a small change here:
https://github.com/lightbody/browsermob-proxy/blob/master/src/main/java/net/lightbody/bmp/proxy/ProxyServer.java#L66

Would you accept that?

I found this snipped how to find a free port. But i don't really now what it implies...

    private int findFreePort()
    {
        try (ServerSocket socket = new ServerSocket(0))
        {
            socket.setReuseAddress(true);
            return socket.getLocalPort();
        }
        catch (IOException e)
        {
            throw new IllegalStateException("Can't acquire free port", e);
        }
    }

Best Regards,
Christian.

Out of memory Issue In Browser Mob Proxy

Hi

Thanks for a good tool. I have used the tool to automate selenium tests to capture network traffic.

I am getting the following issue from yesterday. Before that it was working fine. Please help me to resolve the issue.

The time is0.7394060636926141
INFO 10/08 05:27:22 n.l.b.p.j.h.HttpSer~ - Version Jetty/5.1.x
INFO 10/08 05:27:22 n.l.b.p.j.u.Contain~ - Started HttpContext[/,/]
INFO 10/08 05:27:22 n.l.b.p.j.h.SocketL~ - Started SocketListener on 0.0.0.0:2323
INFO 10/08 05:27:22 n.l.b.p.j.u.Contain~ - Started net.lightbody.bmp.proxy.jetty.jetty.Server@b04d34
INFO 10/08 05:27:22 o.o.s.b.WindowsProx~ - Modifying registry settings...
Started InternetExplorerDriver server (32-bit)
2.35.3.0
Listening on port 22404
INFO 10/08 05:27:29 o.a.h.i.c.DefaultHt~ - I/O exception (java.net.SocketException) caught when processing request: Software caused connection abort: recv failed
INFO 10/08 05:27:29 o.a.h.i.c.DefaultHt~ - Retrying request
INFO 10/08 05:27:31 n.l.b.p.j.u.Credent~ - Checking Resource aliases
INFO 10/08 05:27:31 n.l.b.p.j.h.SocketL~ - Started SocketListener on 0.0.0.0:59188
INFO 10/08 05:27:34 n.l.b.p.j.h.SocketL~ - Started SocketListener on 0.0.0.0:59193
INFO 10/08 05:27:35 n.l.b.p.j.h.SocketL~ - Started SocketListener on 0.0.0.0:59199
INFO 10/08 05:27:36 n.l.b.p.j.h.SocketL~ - Started SocketListener on 0.0.0.0:59205
INFO 10/08 05:27:36 n.l.b.p.j.h.SocketL~ - Started SocketListener on 0.0.0.0:59208
The title of the page is: American Express India | Official Homepage
INFO 10/08 05:27:37 n.l.b.p.j.h.SocketL~ - Started SocketListener on 0.0.0.0:59212
INFO 10/08 05:27:39 n.l.b.p.j.h.SocketL~ - Started SocketListener on 0.0.0.0:59220
Exception in thread "SocketListener0-10" java.lang.OutOfMemoryError: Java heap space
at net.lightbody.bmp.proxy.jetty.util.LineInput$LineBuffer.(LineInput.java:697)
at net.lightbody.bmp.proxy.jetty.util.LineInput.(LineInput.java:122)
at net.lightbody.bmp.proxy.jetty.http.HttpInputStream.(HttpInputStream.java:70)
at net.lightbody.bmp.proxy.jetty.http.HttpConnection.(HttpConnection.java:115)
at net.lightbody.bmp.proxy.jetty.http.SocketListener.createConnection(SocketListener.java:256)
at net.lightbody.bmp.proxy.jetty.http.SocketListener.handleConnection(SocketListener.java:224)
at net.lightbody.bmp.proxy.jetty.util.ThreadedServer.handle(ThreadedServer.java:357)
at net.lightbody.bmp.proxy.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
Exception in thread "SocketListener0-6" java.lang.OutOfMemoryError: Java heap space
at net.lightbody.bmp.proxy.jetty.util.LineInput$LineBuffer.(LineInput.java:697)
at net.lightbody.bmp.proxy.jetty.util.LineInput.(LineInput.java:122)
at net.lightbody.bmp.proxy.jetty.http.HttpInputStream.(HttpInputStream.java:70)
at net.lightbody.bmp.proxy.jetty.http.HttpConnection.(HttpConnection.java:115)
at net.lightbody.bmp.proxy.jetty.http.SocketListener.createConnection(SocketListener.java:256)
at net.lightbody.bmp.proxy.jetty.http.SocketListener.handleConnection(SocketListener.java:224)
at net.lightbody.bmp.proxy.jetty.util.ThreadedServer.handle(ThreadedServer.java:357)
at net.lightbody.bmp.proxy.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
WARN 10/08 05:28:38 n.l.b.p.j.u.Threade~ - EXCEPTION
java.lang.OutOfMemoryError: Java heap space
at java.io.ByteArrayOutputStream.(ByteArrayOutputStream.java:77)
at sun.security.ssl.OutputRecord.(OutputRecord.java:76)
at sun.security.ssl.OutputRecord.(OutputRecord.java:86)
at sun.security.ssl.AppOutputStream.(AppOutputStream.java:52)
at sun.security.ssl.SSLSocketImpl.init(SSLSocketImpl.java:587)
at sun.security.ssl.SSLSocketImpl.(SSLSocketImpl.java:494)
at sun.security.ssl.SSLServerSocketImpl.accept(SSLServerSocketImpl.java:313)
at net.lightbody.bmp.proxy.jetty.util.ThreadedServer.acceptSocket(ThreadedServer.java:432)
at net.lightbody.bmp.proxy.jetty.util.ThreadedServer$Acceptor.run(ThreadedServer.java:634)
WARN 10/08 05:29:07 n.l.b.p.j.u.Threade~ - EXCEPTION
java.lang.OutOfMemoryError: Java heap space
WARN 10/08 05:29:11 n.l.b.p.j.u.Threade~ - EXCEPTION
java.lang.OutOfMemoryError: Java heap space
WARN 10/08 05:29:10 n.l.b.p.j.u.Threade~ - EXCEPTION
java.lang.OutOfMemoryError: Java heap space
Exception in thread "SocketListener0-2" java.lang.OutOfMemoryError: Java heap space
WARN 10/08 05:29:20 n.l.b.p.j.u.Threade~ - EXCEPTION
java.lang.OutOfMemoryError: Java heap space
WARN 10/08 05:29:44 n.l.b.p.j.h.HttpCon~ - CONNECT www293.americanexpress.com:443 HTTP/1.0
java.lang.OutOfMemoryError: Java heap space
Exception in thread "SocketListener0-0" java.lang.OutOfMemoryError: Java heap space
WARN 10/08 05:29:43 n.l.b.p.j.u.Threade~ - EXCEPTION
java.lang.OutOfMemoryError: Java heap space
WARN 10/08 05:29:41 n.l.b.p.j.u.Threade~ - Stopping Acceptor ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=2323]
Exception in thread "Acceptor ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=2323]" java.lang.OutOfMemoryError: Java heap space
WARN 10/08 05:29:33 n.l.b.p.j.u.Threade~ - Stopping Acceptor [SSL: ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=59212]]
Exception in thread "Acceptor [SSL: ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=59212]]" java.lang.OutOfMemoryError: Java heap space
WARN 10/08 05:29:50 n.l.b.p.j.u.Threade~ - EXCEPTION
java.lang.OutOfMemoryError: Java heap space
WARN 10/08 05:29:52 n.l.b.p.j.u.Threade~ - EXCEPTION
java.lang.OutOfMemoryError: Java heap space
WARN 10/08 05:30:01 n.l.b.p.j.h.HttpCon~ - CONNECT talkx.l.google.com:443 HTTP/1.1
java.lang.OutOfMemoryError: Java heap space
WARN 10/08 05:30:04 n.l.b.p.j.u.Threade~ - EXCEPTION
java.lang.OutOfMemoryError: Java heap space
WARN 10/08 05:30:12 n.l.b.p.j.u.Threade~ - EXCEPTION
java.lang.OutOfMemoryError: Java heap space
WARN 10/08 05:30:18 n.l.b.p.j.u.Threade~ - EXCEPTION
java.lang.OutOfMemoryError: Java heap space
Exception in thread "Acceptor [SSL: ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=59208]]" java.lang.OutOfMemoryError: Java heap space
WARN 10/08 05:30:17 n.l.b.p.j.h.HttpCon~ - CONNECT talkx.l.google.com:5222 HTTP/1.1
java.lang.OutOfMemoryError: Java heap space
WARN 10/08 05:30:22 n.l.b.p.j.u.Threade~ - EXCEPTION
java.lang.OutOfMemoryError: Java heap space
WARN 10/08 05:30:24 n.l.b.p.j.u.Threade~ - EXCEPTION
java.lang.OutOfMemoryError: Java heap space

Cant proxy HTTP requests

Hi,

For some reason I cannot proxy HTTP requests.. When I try to load a HTTP page, the browser just shows an empty/blank page. I disabled HTTP proxying with the seleniumProxy object and the HTTP page loads fine then, however, this is not what I'm looking for since I want to proxy the request, so i can inspect its contents.

the test below loads HTTP requests, if I comment out proxy.setHttpProxy(""), it no longer loads the non SSL page.

HTTPS works fine.

    @Test
     public void test() throws Exception{

    // start the proxy
    ProxyServer server = new ProxyServer(4444);
    server.start();     
    server.setCaptureHeaders(true);
    server.setCaptureContent(true);

    // get the selenium proxy object
    Proxy proxy = server.seleniumProxy();

    proxy.setHttpProxy("");
        //proxy.setHttpsProxy("");
    DesiredCapabilities capabilities = new DesiredCapabilities();

    capabilities.setCapability(CapabilityType.PROXY, proxy);

        // start the browser up
    WebDriver driver = new FirefoxDriver(capabilities);

    server.newHar("assertselenium.com");

    driver.get("http://whatsmyuseragent.com");
        //driver.get("https://google.com");

    // get the HAR data
    Har har = server.getHar();
    Thread.sleep(10000);
    server.stop();
    driver.quit();
}

I'm using

  <properties>
    <webdriver.version>2.34.0</webdriver.version>
    <bmp.version>2.0-beta-9-SNAPSHOT</bmp.version>
</properties>

Any help would be appreciated!

Cannot start proxy

Installed with:

mvn -DskipTests -P release

Note that tests did not pass with the -D switch omittted.

Start up with:
sh browsermob-proxy -port 9090

Using Java version: 1.7
INFO 08/25 22:41:49 n.s.u.i.d.DataBuild~ - No pattern available for 'Other'.
INFO 08/25 22:41:49 n.s.u.i.d.DataBuild~ - No pattern available for 'Personal computer'.
INFO 08/25 22:41:49 n.s.u.i.d.DataBuild~ - No pattern available for 'Personal computer'.
INFO 08/25 22:41:49 n.l.b.p.Main         - Starting BrowserMob Proxy version 2.0-beta-10-SNAPSHOT
INFO 08/25 22:41:50 o.e.j.u.log          - jetty-7.3.0.v20110203
INFO 08/25 22:41:50 o.e.j.u.log          - started o.e.j.s.ServletContextHandler{/,null}
INFO 08/25 22:41:50 o.e.j.u.log          - Started [email protected]:9090

But when trying to start proxy:

curl -X POST http://localhost:9090/proxy

WARN 08/25 22:44:34 o.e.j.u.log          - /proxy
com.google.sitebricks.routing.EventDispatchException: Exception [ExceptionInInitializerError - "null"] thrown by event method [public com.google.sitebricks.headless.Reply net.lightbody.bmp.proxy.bricks.ProxyResource.newProxy(com.google.sitebricks.headless.Request) throws java.lang.Exception]

at net.lightbody.bmp.proxy.jetty.http.HttpContext.<init>(HttpContext.java:148)
(See below for entire trace.)

    at com.google.sitebricks.routing.DefaultPageBook$MethodTuple.call(DefaultPageBook.java:678)
    at com.google.sitebricks.routing.DefaultPageBook$MethodTuple.call(DefaultPageBook.java:665)
    at com.google.sitebricks.routing.DefaultPageBook$PageTuple.callAction(DefaultPageBook.java:544)
    at com.google.sitebricks.routing.DefaultPageBook$PageTuple.doMethod(DefaultPageBook.java:528)
    at com.google.sitebricks.routing.WidgetRoutingDispatcher.fireEvent(WidgetRoutingDispatcher.java:137)
    at com.google.sitebricks.routing.WidgetRoutingDispatcher.bindAndReply(WidgetRoutingDispatcher.java:90)
    at com.google.sitebricks.routing.WidgetRoutingDispatcher.dispatch(WidgetRoutingDispatcher.java:73)
    at com.google.sitebricks.DebugModeRoutingDispatcher.dispatch(DebugModeRoutingDispatcher.java:63)
    at com.google.sitebricks.SitebricksFilter.doFilter(SitebricksFilter.java:41)
    at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
    at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
    at com.google.sitebricks.HiddenMethodFilter.doFilter(HiddenMethodFilter.java:74)
    at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
    at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
    at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
    at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1323)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:474)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:224)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:935)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:404)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:184)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:870)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    at org.eclipse.jetty.server.Server.handle(Server.java:346)
    at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:596)
    at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:1051)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:592)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:214)
    at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:426)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:520)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:528)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.google.sitebricks.routing.DefaultPageBook$MethodTuple.call(DefaultPageBook.java:671)
    ... 34 more
Caused by: java.lang.ExceptionInInitializerError
    at net.lightbody.bmp.proxy.jetty.http.HttpContext.<init>(HttpContext.java:148)
    at net.lightbody.bmp.proxy.ProxyServer.start(ProxyServer.java:65)
    at net.lightbody.bmp.proxy.ProxyManager.create(ProxyManager.java:43)
    at net.lightbody.bmp.proxy.bricks.ProxyResource.newProxy(ProxyResource.java:72)
    ... 39 more
Caused by: java.util.MissingResourceException: Can't find bundle for base name net/lightbody/bmp/proxy/jetty/http/mime, locale en_US
    at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1499)
    at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1322)
    at java.util.ResourceBundle.getBundle(ResourceBundle.java:721)
    at net.lightbody.bmp.proxy.jetty.http.ResourceCache.<clinit>(ResourceCache.java:43)
    ... 43 more

Compilation error - jetty-* does not exist

Executing in master branch (3f443e0 ) command mvm -Prelease -DskipTests install and see:
[ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /tmp/bmp/browsermob-proxy/src/main/java/net/lightbody/bmp/proxy/http/BrowserMobHttpClient.java:[41,29] error: package org.eclipse.jetty.util does not exist [ERROR] /tmp/bmp/browsermob-proxy/src/main/java/net/lightbody/bmp/proxy/http/BrowserMobHttpClient.java:[42,29] error: package org.eclipse.jetty.util does not exist [ERROR] /tmp/bmp/browsermob-proxy/src/main/java/net/lightbody/bmp/proxy/selenium/ClassPathResource.java:[4,29] error: package org.eclipse.jetty.util does not exist [ERROR] /tmp/bmp/browsermob-proxy/src/main/java/net/lightbody/bmp/proxy/http/BrowserMobHttpClient.java:[538,9] error: cannot find symbol [ERROR] class BrowserMobHttpClient /tmp/bmp/browsermob-proxy/src/main/java/net/lightbody/bmp/proxy/http/BrowserMobHttpClient.java:[538,39] error: cannot find symbol [ERROR] class BrowserMobHttpClient /tmp/bmp/browsermob-proxy/src/main/java/net/lightbody/bmp/proxy/http/BrowserMobHttpClient.java:[539,9] error: cannot find symbol [ERROR] class BrowserMobHttpClient /tmp/bmp/browsermob-proxy/src/main/java/net/lightbody/bmp/proxy/guice/JettyServerProvider.java:[11,52] error: cannot access AggregateLifeCycle [ERROR] class file for org.eclipse.jetty.util.component.AggregateLifeCycle not found /tmp/bmp/browsermob-proxy/src/main/java/net/lightbody/bmp/proxy/guice/JettyModule.java:[10,14] error: no suitable method found for bind(Class<Server>) [ERROR] /tmp/bmp/browsermob-proxy/src/main/java/net/lightbody/bmp/proxy/Main.java:[46,32] error: no suitable method found for getInstance(Class<Server>) [ERROR] T#1 extends Object declared in method <T#1>getInstance(Class<T#1>) T#2 extends Object declared in method <T#2>getInstance(Key<T#2>) /tmp/bmp/browsermob-proxy/src/main/java/net/lightbody/bmp/proxy/Main.java:[53,14] error: cannot find symbol [ERROR] variable server of type Server /tmp/bmp/browsermob-proxy/src/main/java/net/lightbody/bmp/proxy/selenium/ClassPathResource.java:[29,4] error: cannot find symbol [INFO] 11 errors

Fixed it in pom.xml and found similar issues. I will do pull requet with fix soon.
OS - Ubuntu 14.04 LTS.

Do not getting blacklist rules

after calling
curl -X PUT -d 'regex=.*facebook.*' -d 'status=306' http://localhost:9090/proxy/9091/blacklist

I am getting this :

curl -X GET http://localhost:9090/proxy/9091/blacklist

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 500 Sitebricks received a null reply from the resource.</title>
</head>
<body>
<h2>HTTP ERROR: 500</h2>
<p>Problem accessing /proxy/9091/blacklist. Reason:
<pre>    Sitebricks received a null reply from the resource.</pre></p>
<hr /><i><small>Powered by Jetty://</small></i>
</body>
</html>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.