Just a heads up I am relatively new to nodeJs, websockets and stackoverflow,
I am using a websocket to send data to and from my javaScript front-end, this works without any issues, as does the websocket connection to Loriot initially.
However once I begin using the node websocket frequently the Loriot websocket stops receiving any data without triggering the .onclose or .onerror functions.
As no error or close is triggered re-opening the connection in the event of this isn't possible.
Anyone have any idea what may be causing this interference, thanks in advance?
var WebSocketServer = require('websocket').server;
var express = require('express');
var app = express();
var server = app.listen(8888);
var wsServer = new WebSocketServer({ httpServer : server });
const url = 'wss://eu4pro.loriot.io/***************************'
const loriotConnection = new WebSocket(url)
loriotConnection.onopen = function(event) {
console.log("Loriot WebSocket is open now.");
};
loriotConnection.onclose = function(event) {
console.log("Loriot WebSocket is CLOSED now.");
};
loriotConnection.onerror = function(event) {
console.log('error')
}
loriotConnection.onmessage = e => {
console.log(e.data)
}