title: Socket connection into Docker initially succeeds then fails
body: <p>Running under MacOS I am connecting from a node.js app with net.Socket() into a Docker container running on the same host, which contains a C++ sockets server under Centos. The Docker run command is:</p>
  
  <pre><code>docker run -it --rm -p 14000-14010:14000-14010 -v /Users/me/Development/spdz:/spdz spdz/spdzdev
  </code></pre>
  
  <p>When the c++ server in docker is <strong>not</strong> running, I see a successful connection in node followed 3ms later by a socket closed message.</p>
  
  <p>It appears as if a proxy in front of the container is accepting the request, passing it through to Docker where it is rejected. However this leads to erroneous messages in my front end application which thinks the connection was successful, only to find out later it was not.</p>
  
  <p>I would like to see a simple connection declined. Any suggestions as to how this may be remedied or better understood would be helpful. </p>
  
  <p>I am confident that the behaviour is introduced by Docker, as running the components outside Docker gives the expected immediate failure on connection. Also I have tried mapping the exported ports to an external network interface rather than localhost but see the same behaviour.</p>