title: How to ignore all websocket connections with mitmproxy?
body: <p>At the moment, mitmproxy doesn't seem to be able to handle websocket connections.</p>
  
  <p>How can I just pass these on so that clients can still connect with a websocket server?</p>
  
  <p>Here's my current command:</p>
  
  <p><img src="https://i.stack.imgur.com/QV5pP.png" alt="./mitmproxy --anticache -s injectScripts.py"></p>
  
  <p>Specifically, in my case, I'd <em>currently</em> like clients using my proxy to be able to play games on <a href="http://agar.io/" rel="nofollow noreferrer">agar.io</a>, which uses a websocket connection to communicate with a (for our purposes, random) server which hosts the game.</p>
  
  <p>Examples of game-hosting servers which agar.io connects to: <em>ws://151.80.96.51:1515</em>, <em>ws://37.187.171.110:1523</em>, <em>ws://37.187.163.130:1518</em>.</p>
  
  <p><strong>I've already tried</strong> using mitmproxy's <a href="http://docs.mitmproxy.org/en/stable/features/passthrough.html" rel="nofollow noreferrer">Ignore Domains</a> feature (both from the command line and from within the program), as well as their recommended <a href="http://docs.mitmproxy.org/en/stable/features/tcpproxy.html#tcpproxy" rel="nofollow noreferrer">TCP Proxy</a> feature. This was the pattern I tried using:</p>
  
  <p><img src="https://i.stack.imgur.com/k7HcK.png" alt="./mitmproxy --anticache -s injectScripts.py --ignore ^agar.io$"></p>
  
  <p>But this just stops agar.io from loading at all (grey background, correct document title but that's it).</p>
  
  <p>I think that because the client is connecting to different servers (not <em>ws://agar.io</em>) I can't use a simple domain ignore, but I may be wrong.</p>
  
  <hr>
  
  <p>While at the moment I'm only interested in agar.io, it would be nice to have a solution for all websocket servers.</p>
  
  <p>So, in short, how can I allow clients to connect to ws servers?</p>