I am using WAMP offline server and I installed NodeJS for my chat application. The chat application works fine but I receive this error in my console
WebSocket connection to 'ws://localhost:8000/socket.io/1/websocket/1300942723267398434' failed: Connection closed before receiving a handshake response
Even though the application works fine, but I don't want to see that error and I believe if I upload my application to a live server, it won't work perfectly because of this error.
I have tried many solutions from SO but it didn't work for me:
- Socket.io - failed: Connection closed before receiving a handshake response
- WebSocket connection to 'ws://localhost:3000/' failed: Connection closed before receiving a handshake response
- Socket.io: Connection closed before receiving a handshake response
Below is my back end code
var io = require('socket.io').listen(8000),
dns = require('dns'),
express = require('express'),
mysql = require('mysql');
On the front end:
socket = io.connect('http://localhost:8000');