Answer the question
In order to leave comments, you need to log in
How to get client request in socket.io?
Good day. Suppose when rendering jade-file an object with fields user, post, title , ect is given. How to get this object in socket.io when connecting?
var io = require('socket.io')(http);
io.on('connection', function (socket) {
// there to get a client request / or server object for page rendering
.....
Answer the question
In order to leave comments, you need to log in
io.on('connection', function (socket) {
//socket.request - request
//socket.request.res - response
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question