title: How can I increase the maximum number of websocket connections on my local machine?
body: <p>I am writing a game using websocket with <a href="https://github.com/websockets/ws" rel="nofollow noreferrer">ws module</a> and I try to create some virtual websocket connections on my local computer to test it. However when I created more than 250 connections it gives an error: </p>
  
  <pre><code> throw er; // Unhandled 'error' event
        ^
  
  Error: connect ECONNRESET 127.0.0.1:9999
      at Object.exports._errnoException (util.js:1014:11)
      at exports._exceptionWithHostPort (util.js:1037:20)
      at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1138:14)
  </code></pre>
  
  <p>How to remove this error and get more connections for testing? I don't get the error when the connection number is in the range of 1 - 210. But over 210 sometimes I get this error and if the connection number is over 250 I always get this error. I am not sure what causes this error. Is it because my computer is not capable of handling so many local connections? I am using OSX Yosemite (10.10.5)</p>