webmetrics / browsermob-proxy

NOTICE: this project has been forked and is being maintained at https://github.com/lightbody/browsermob-proxy
https://github.com/lightbody/browsermob-proxy
Apache License 2.0
234 stars 773 forks source link

Support /etc/hosts for name resolution #14

Closed henryju closed 12 years ago

henryju commented 13 years ago

Hi,

I have defined the following host definition in /etc/hosts 127.0.0.1 localhost mycomputer.mycompany.org

Then I tried to use BrowserMob Proxy but name resolution failed:

15:30:17.973 DEBUG o.b.proxy.jetty.http.HttpContext - Handler org.browsermob.proxy.BrowserMobProxyHandler in HttpContext[/,/] 15:30:17.981 DEBUG o.b.p.http.BrowserMobHttpClient$1 - Get connection: HttpRoute[{}->http://mycomputer.mycompany.com:8082], timeout = 60000 15:35:47.826 DEBUG o.b.p.http.BrowserMobHttpClient$1 - Released connection is not reusable. INFO 09/21 13:35:47 o.b.p.h.BrowserMobH~ - java.net.UnknownHostException: mycomputer.mycompany.com when requesting http://mycomputer.mycompany.com:8082/xxxxxxxxx

Thanks

lightbody commented 12 years ago

This is already supported with the remapHost function.