feat(utilities): WS logs
This commit is contained in:
parent
e2051d3b7f
commit
11a70d7add
1 changed files with 6 additions and 1 deletions
|
|
@ -128,6 +128,10 @@ async function get_all_agents_ids(io, socket) {
|
|||
|
||||
function extractSessionInfo(socket) {
|
||||
if (socket.handshake.query.sessionInfo !== undefined) {
|
||||
console.log("received headers");
|
||||
console.log(socket.handshake.headers);
|
||||
console.log("received sessionInfo");
|
||||
console.log(socket.handshake.query.sessionInfo);
|
||||
socket.handshake.query.sessionInfo = JSON.parse(socket.handshake.query.sessionInfo);
|
||||
let ua = uaParser(socket.handshake.headers['user-agent']);
|
||||
socket.handshake.query.sessionInfo.userOs = ua.os.name;
|
||||
|
|
@ -150,7 +154,8 @@ function extractSessionInfo(socket) {
|
|||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
console.log("edited sessionInfo");
|
||||
console.log(socket.handshake.query.sessionInfo);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue