Is it possible to disconnect from localhost?
I'm writing a Node.js WebSocket server, and I want to test locally what would happen if the connection closes erroneously.
If I were testing remotely, I'd just Turn Wi-Fi Off, but that doesn't disconnect my connection to localhost.
Thoughts?
localhost
is just an alias in your hosts file. If you remove that alias then you'll be effectively "disconnecting" from localhost.
I don't know of any way you would do what your asking except perhaps to block the ports or the program you are running on your localhost via its firewall.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With