I'm getting data from a web page with websocket but I need to deploy it with socketIO to client. In my server.js client connects with socketio well but after that data(line1 line2) can't comes properly, always I need to restart server 2-3 times.Then it comes.
Here is my declerations
var server = require('http').Server(app);
var io = require('socket.io')(server);
const WebSocket = require('ws')
const wss = new WebSocket('gettingDataAdress');
io.on('connection', function (socket) {
console.log("client connected");
wss.on('open', () => {
console.log("send processing");
//line1
})
wss.on('message', () => {
console.log("getting message processing");
//line2
})
After restarting my server.js 2-3 times it can comes to line1 and line2 , it can't directly.However whenever I comment the socketio Part(I mean only websocket working) it works perfect.How can I do that ? Thank you