Answer the question
In order to leave comments, you need to log in
Why is socket.io losing connection?
Good evening everyone. At the moment I am developing VK MINI APPS applications.
I use React, node.js and socket.io technologies (in conjunction with socket.io-client, both have version 4.2.0).
Faced the following problem: when the button is clicked, the transition to the
Client link is triggered:
window.open("https://vk.com/id"+user_id, "_blank")
import io from 'socket.io-client'
const socket = io('LINK', {
transports: ['websocket', 'polling']
})
import { Server as Socket } from 'socket.io'
const io = new Socket(http, {
cors: {
origin: "*",
methods: ["GET", "POST"]
}
})
Answer the question
In order to leave comments, you need to log in
I did not find another solution, how to return to the old version of socket.io, which I peeped from one of the previous projects. Installed version 2.3.0.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question