Answer the question
In order to leave comments, you need to log in
How to handle net::ERR_CONNECTION_REFUSED in Socket.IO?
When the connection is lost, the browser starts typing GET request error messages to the console. I need to process this case, but after trying different handlers it turns out that they work out after this error message. How it's done?
this.socket = SocketIO(url);
/*
connect_error
reconnect_error
reconnect_attempt
reconnecting
reconnect
*/
this.socket.on('reconnect', () => console.log('reconnect'));
this.socket.on('reconnect_attempt', () => console.log('reconnect_attempt'));
this.socket.on('reconnecting', () => console.log('reconnecting'));
this.socket.on('reconnect_error', () => console.log('reconnect_error'));
this.socket.on('connect_error', () => console.log('connect_error'));
this.socket.on('error', () => console.log('error'));
this.socket.on('connect_timeout', () => console.log('connect_timeout'));
this.socket.on('reconnect_failed', () => console.log('reconnect_failed'));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question