I'm having problems connecting to my WebSocket server through the VirtualBox port forwards. The forwarding rules themselves work just fine (I use them all the time for http and ssh) and the WebSocket server does just fine aswell, when connecting from within the VirtualBox guest (via wscat
for example). When I try to connect to the server from my host it says "Connection Reset"
in my browsers and "error: Error: socket hang up
" in wscat. If I remove the port forwarding rule from virtualbox or change the port the server is running on (which is more or less the same thing), it says "error: Error: connect ECONNREFUSED"
, which means that there is at least something going on. The WebSocket server console does not say anything when connecting from the host.
Well, this is embarrassing. The only thing I had to do was change the address for the WebSocket server to run on to 0.0.0.0
instead of using localhost
...