fix: add logging for URL and token in WebSocket client verification
This commit is contained in:
@@ -13,8 +13,10 @@ module.exports = function setupSensorWebSocket(server) {
|
|||||||
path: wsPath,
|
path: wsPath,
|
||||||
perMessageDeflate: false,
|
perMessageDeflate: false,
|
||||||
verifyClient: async (info, callback) => {
|
verifyClient: async (info, callback) => {
|
||||||
|
console.log('[WS|verifyClient] URL:', info.req.url);
|
||||||
const { query } = url.parse(info.req.url, true);
|
const { query } = url.parse(info.req.url, true);
|
||||||
const token = query.token;
|
const token = query.token;
|
||||||
|
console.log('[WS|verifyClient] Token ricevuto:', token);
|
||||||
|
|
||||||
if (!token) {
|
if (!token) {
|
||||||
return callback(false, 401, 'token not passed');
|
return callback(false, 401, 'token not passed');
|
||||||
|
|||||||
Reference in New Issue
Block a user