2
votes

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:

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');
1

1 Answers

0
votes

I have found the solution... The error came as a result of unsecured connection http after creating a secured connection to the server, the application work fine