The following errors are often found:
websocket.js?0882:235 WebSocket connection to 'ws://192.168.199.201:3030/socket.io/?EIO=3&transport=websocket' failed: WebSocket is closed before the connection is established.

i Don't know why,i need to refresh the page many times until i can continue to connect.
It happens on average once a day. Please instruct me.
Forcing websockets via {transports: ['websocket']} when establishing the socket usually solves these kinds of issues. Another thing mentioned here is to restart your browser if you are using Chrome.
No effect, I local two computer connection is very difficult, a server, a front end. Very distressed.
It's already set up like this:
// Set up Plugins and providers
app.configure(express.rest());
app.configure(
socketio({ transports: ['websocket'], wsEngine: 'uws' }, function(io) {
// Registering Socket.io middleware
io.use(function(socket, next) {
// Exposing a request property to services and hooks
socket.feathers.ip =
socket.handshake.headers['x-forwarded-for'] || socket.handshake.address;
next();
});
})
);
transports: ['websocket'] needs to be used on the client establishing the connection, not on the server.
yes, i have set like this:
const socket = io('http://xxxxxxxxx', {
transports: ['websocket']
upgrade: false
})
but it‘’s still unstable.
and I found a new situation, if the server in the local LAN, the connection is not stable, but on the external network server, the connection becomes much more stable, so this may be the problem of the LAN router?
Some probleme :
Found a fix for this?
Also experiencing this issue. Version 4.4.3 of all libraries.
There is a lot of information e.g. in this question: https://stackoverflow.com/questions/41381444/websocket-connection-failed-error-during-websocket-handshake-unexpected-respon for example, when using an NginX proxy it needs some additional configuration. You also should not use clusters with pm2 (see https://github.com/socketio/socket.io/issues/798) unless you are using something like https://github.com/feathersjs-ecosystem/feathers-sync
There is a lot of information e.g. in this question: https://stackoverflow.com/questions/41381444/websocket-connection-failed-error-during-websocket-handshake-unexpected-respon for example, when using an NginX proxy it needs some additional configuration. You also should not use clusters with pm2 (see socketio/socket.io#798) unless you are using something like https://github.com/feathersjs-ecosystem/feathers-sync
I turn off pm2 cluster > fixed error socket 400