Thursday, 8 June 2017

Not Found error for socket.io on the client-side

I am trying to include socket.io on the client-side. I keep getting this error message in the console every 5 seconds:

GET https://example.com/socket.io/?EIO=3&transport=polling&t=Lo8ssW0 404 (Not Found)

My code:

script(src='https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.0.2/socket.io.slim.js')
var socketio = io.connect('https://example.com',{secure: true, port:5089})

On the server-side I have:

const socketio = app.listen(5089)
var io = require('socket.io')(socketio)

which works correctly.

What am I doing wrong?



via konyv12

No comments:

Post a Comment