mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-11-22 22:17:31 +03:00
Update apprelays.js
if header is not null for websockets
This commit is contained in:
parent
5ba9d7e503
commit
0f85b186cc
@ -638,6 +638,7 @@ module.exports.CreateWebRelay = function (parent, db, args, domain) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Tunnel is now in web socket pass-thru mode
|
// Tunnel is now in web socket pass-thru mode
|
||||||
|
if (header != null) {
|
||||||
if ((typeof header.connection == 'string') && (header.connection.toLowerCase() == 'upgrade')) {
|
if ((typeof header.connection == 'string') && (header.connection.toLowerCase() == 'upgrade')) {
|
||||||
// Websocket upgrade succesful
|
// Websocket upgrade succesful
|
||||||
obj.socketParseState = 2;
|
obj.socketParseState = 2;
|
||||||
@ -647,6 +648,7 @@ module.exports.CreateWebRelay = function (parent, db, args, domain) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Send data thru the relay tunnel. Written to use TLS if needed.
|
// Send data thru the relay tunnel. Written to use TLS if needed.
|
||||||
function send(data) { try { if (obj.tls) { obj.tls.write(data); } else { obj.wsClient.send(data); } } catch (ex) { } }
|
function send(data) { try { if (obj.tls) { obj.tls.write(data); } else { obj.wsClient.send(data); } } catch (ex) { } }
|
||||||
|
Loading…
Reference in New Issue
Block a user