title: Is it possible to temporarily disable a websockets connection in a local server environment?
body: <p>I have a Node.js script that uses websockets (socket.io). The script is running on my computer (e.g. local server environment) and I also tests through a browsers on my computer. I am trying to gracefully handle disconnections and reconnections. So far I have emulated network disturbances by disable/enable the WiFi on my iPad. <strong>Is it possible to disable and resume the browser's web socket connection on my local machine, i.e. through a browser plugin, third party proxy software, or some other tool?</strong></p>
  
  <hr>
  
  <p>So fare I have tried:</p>
  
  <ul>
  <li><strong>Chrome developer tool:</strong> In its <em>Device Mode</em> there is a <em>Networks Conditions</em> <a href="https://developer.chrome.com/devtools/docs/device-mode#network-conditions" rel="noreferrer">option</a>, which allows me to emulate various network connectivity. Unfortunately <a href="https://code.google.com/p/chromium/issues/detail?id=423246&amp;q=websocket%20network&amp;colspec=ID%20Pri%20M%20Week%20ReleaseBlock%20Cr%20Status%20Owner%20Summary%20OS%20Modified" rel="noreferrer">at this point in time</a> it only applies to HTTP-connections and not to the websocket connections.</li>
  <li><strong><a href="http://www.charlesproxy.com" rel="noreferrer">Charles</a>:</strong> It records the websocket connections, but does not throttle them. (I've set bandwidth, utilisation and MTU to zero, but still receive responses trough the websocket connection).</li>
  <li><strong><a href="http://www.telerik.com/fiddler" rel="noreferrer">Fiddler</a>:</strong> Similarly records the websocket connections, but does not block them.</li>
  </ul>