Answer the question
In order to leave comments, you need to log in
How to get a client request from a Socket object?
Good day.
I use socket.io
How to get a client request from the Socket object? (The object that the server gives when rendering)
Answer the question
In order to leave comments, you need to log in
Смотря какую библиотеку используете для сокетов, если websocket, то:
var websocket = require('websocket');
server.websocket = new websocket.server({ httpServer: server, autoAcceptConnections: false });
server.websocket.on('request', function(socket) {
var req = socket.httpRequest;
var res = socket.socket;
});
console.dir(Object.keys(socket));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question