title: BrowserMob Proxy’s - WebDriver / Error: The proxy server is refusing connections
body: <p>I try to use <code>BrowserMob Proxy’s</code> with <code>WebDriver</code>. I use the next code:</p>
  
  <pre><code>public static void main(String[] args) throws Exception {
  
          String strFilePath = "";
  
          // start the proxy
          ProxyServer server = new ProxyServer(4455);
          server.start();
          //captures the moouse movements and navigations
          server.setCaptureHeaders(true);
          server.setCaptureContent(true);
  
          // get the Selenium proxy object
          Proxy proxy = server.seleniumProxy();
  
          // configure it as a desired capability
          DesiredCapabilities capabilities = new DesiredCapabilities();
          capabilities.setCapability(CapabilityType.PROXY, proxy);
  
          // start the browser up
          WebDriver driver = new FirefoxDriver(capabilities);
  
          // create a new HAR with the label "apple.com"
          server.newHar("assertselenium.com");
  
          // open yahoo.com
          driver.get("http://assertselenium.com");
  
          driver.get("http://assertselenium.com/2012/10/30/transformation-from-manual-tester-to-a-selenium-webdriver-automation-specialist/");
  
          // get the HAR data
          Har har = server.getHar();
          FileOutputStream fos = new FileOutputStream(strFilePath);
          har.writeTo(fos);
          server.stop();
          driver.quit();
  
      }
  </code></pre>
  
  <p>And I got the next error: <code>The proxy server is refusing connections: Firefox is configured to use a proxy server that is refusing connections.</code></p>
  
  <p>I try also to run the <code>browsermob-proxy.bat</code> with port <code>4455</code>, and then I get the next error when I run the <code>main</code>:</p>
  
  <pre><code>java.net.BindException: Address already in use: JVM_Bind
  </code></pre>
  
  <p>How I can use BrowserMob Proxy’s?</p>