lang/node

socket.io listen OR attach

C/H 2015. 12. 8. 08:30

var config = { host: ‘localhost’, port: 80 };
var app = express();
var http = require( ‘http’ ).createServer( {}, app ).listen( config.port );
var app.io = require(‘socket.io’).listen( http );
var config = { host: ‘localhost’, port: 80 };
var app = express();
var http = require( ‘http’ ).createServer( {}, app ).listen( config.port );

app.io = require( ‘socket.io’ )();
app.io.attach( http );


반응형

'lang > node' 카테고리의 다른 글

socket.io 1.3.7 cluster On Nodejs 5.1.0  (0) 2015.12.10
PM2  (0) 2015.12.09
Socket.io 0.9.x, 1.x Protocol  (0) 2015.12.04
Upgrade socket.io 1.3.7 On Express 4.13.3  (0) 2015.11.30
nodeclipse debug  (0) 2015.11.25