add verify before ws connection
This commit is contained in:
parent
a3a4f2b5cb
commit
a1bcd06acd
@ -119,12 +119,8 @@ const wss = new WebSocketServer(
|
|||||||
port: 8282,
|
port: 8282,
|
||||||
verifyClient: (info, callback) => {
|
verifyClient: (info, callback) => {
|
||||||
console.log(info.req.url);
|
console.log(info.req.url);
|
||||||
|
|
||||||
const ok = verifyToken(info.req.url || '');
|
const ok = verifyToken(info.req.url || '');
|
||||||
|
|
||||||
console.log(ok);
|
|
||||||
|
|
||||||
|
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
callback(false, 401, 'Unauthorized: Invalid token');
|
callback(false, 401, 'Unauthorized: Invalid token');
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user