LearnBoost/socket.io — Issue #696: Configuring Nginx and Socket.IO
Author: InspiredJW
Created: 2011-12-21 03:07:12+00:00
State: open

http://stackoverflow.com/questions/8584442/configuring-nginx-and-socket-io

I'm trying to configure Nginx to work with Socket.IO

and I have found this in Socket.IO github wiki.

I have installed Nginx 1.1.10.
----------------------------------------------------------------------------------
server {
listen 80;
server_name socket.myserver.com;
location / {
proxy_pass http://localhost:3030;
}
}
Below is my Socket.io code

var io = require('socket.io').listen(3333);

io.configure(function() {
io.enable('browser client etag');
io.set('transports', [
'websocket','xhr-polling'
]);
});

io.sockets.on('connection', function (socket) {
socket.emit('news', { hello: 'world' });
socket.on('my other event', function (data) {
console.log(data);
});
});
--------------------------------------------------------------------

And this is my client site code
###################################################################

###################################################################

I'm confronting problem that the console shows only
--------------------------------------------------------------------------------------------------
info - socket.io started
debug - served static content /socket.io.js
--------------------------------------------------------------------------------------------------
I know that it should creates some logs about "handshakes and heartbeats"

Did I configure something wrong? Or does my code have some errors?