title: BrowserMob proxy and hosts file
body: <p>I'm trying to use <a href="http://opensource.webmetrics.com/browsermob-proxy/" rel="nofollow">BrowserMob proxy</a> to monitor requests sent by WebDriver(Selenium) browser.</p>
  
  <p>I instantiate proxy with:</p>
  
  <pre><code>    server = new ProxyServer(localProxyPort);       
      server.start();
  </code></pre>
  
  <p>Then I create Firefox profile which would use this proxy:</p>
  
  <pre><code>    FirefoxProfile profile = new FirefoxProfile(); 
  
      profile.setPreference("network.proxy.type", 1);
      profile.setPreference("network.proxy.http", "localhost");
      profile.setPreference("network.proxy.http_port", localProxyPort);      
  </code></pre>
  
  <p>My problem is that I have a LOT of different host mapping in my 'hosts' file.
  BrowserMob proxy ignores system hosts file, and tries to resolve ips by itself.</p>
  
  <p>There is a solution:</p>
  
  <pre><code>    server.remapHost("somehost.com", "127.0.0.1");
  </code></pre>
  
  <p>But I cant do it for every host. Is there a way to force proxy to use my system hosts mappings?</p>
  
  <p>Thanks!</p>
  
  <p>Leonti</p>