Skip to content

Instantly share code, notes, and snippets.

@codyyc
Created July 11, 2012 21:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codyyc/fef86f53eb97e1a160a0 to your computer and use it in GitHub Desktop.
Save codyyc/fef86f53eb97e1a160a0 to your computer and use it in GitHub Desktop.
<html>
<head>
<script src="http://pace-test.jit.su/socket.io/socket.io.js"></script>
<script>
var socket = io.connect('http://pace-test.jit.su');
socket.on('news', function (data) {
console.log(data);
socket.emit('my other event', { my: 'data' });
});
</script>
</head>
<body>
</body>
</html>
GET http://pace-test.jit.su/socket.io/1/?t=1342042513488 -200 OK -589ms socket.io.js (line 1632)
And the two errors instantly following:
"NetworkError: 500 Internal Server Error - http://pace-test.jit.su/socket.io/1/websocket/5902873241354834559" 590287...4834559
and:
Firefox can't establish a connection to the server at ws://pace-test.jit.su/socket.io/1/websocket/5902873241354834559.this.websocket = new Socket(this.prepareUrl() + query);
They are then followed by xhr-polling requests
{
"name": "pace-test",
"subdomain": "pace-test",
"version": "0.0.0-7",
"author": "Cody Carnachan <********>",
"scripts": {
"start": "node server.js"
},
"dependencies": {
"socket.io": "0.9.6"
},
"noAnalyze": true,
"engines": {
"node": "0.6"
}
}
var io = require('socket.io').listen(3000);
io.sockets.on('connection', function (socket) {
socket.emit('news', { hello: 'world' });
socket.on('my other event', function (data) {
console.log(data);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment