Client doesn't "onconnect" to Socket.io, but throws error when server is closed

I am in the process of moving a socket.io/node.js server from my local machine to a digitalocean vpn, but I am experiencing some strange connection issues.

I don't see any errors thrown when I try to connect, but the 'connection' event isn't fired on client or server side.

However, if I close the server, I get this error on client side: GET http://myip:8000/socket.io/1/?t=1410475126223 net::ERR_CONNECTION_RESET

So it seems that it is actually connecting, just not firing any events?

Here is my server side code:

var app = express();
var server = app.listen(8000);
io = require("socket.io").listen(server);
io.sockets.on("connection", onSocketConnection);

and client side:

socket = io.connect("104.131.41.120", {port: 8000});
socket.on("connect", onSocketConnection);