I use websocket on my site, but by chance it sends me the following error message:
WebSocket connection with 'ws: //client.mydomain.com/socket.io/? EIO = 3 & transport = websocket & sid = 4Kbec5T_XStAC949AACS 'failed: WebSocket handshake error: unexpected response code: 500
This is how I connect to websocket in my application (note that this is an Angular application).
app.factory('clientSocket', ['$sessionStorage', 'socketFactory', function ($sessionStorage, socketFactory) { var connection = ''; $.ajax({ url: 'config.json', async: false, dataType: 'json', success: function (response) { connection = response.app_url; } }); var myIoSocket = io.connect(connection); var clientSocket = socketFactory({ ioSocket: myIoSocket }); clientSocket.forward('someEvent'); clientSocket.on('connect', function () { if ($sessionStorage.activeUser != null) { clientSocket.emit('userData', $sessionStorage.activeUser.user); } }); return clientSocket; }]);
I'm not quite sure what the problem is, but basically the connection string looks like this:
http:
Can someone tell me what is going on?
source share