title: How to simulate tcp connection loss on localhost
body: <p>I have a <code>ASP NET Core</code> web api that uses websockets. I am trying to find out if the server handles internet connection loss (client side) correctly.</p>
  <p>However since I have only one machine on which both the server and the client run, i know that <code>localhost</code> does not use the Network Interface, and the desired handler is not triggered when I cut off the internet.</p>
  <p>How can I thus have a server that runs a localhost, and a client that also runs on localhost but uses the network interface, so that I can cut the internet off and see how the server behaves for the given client?</p>