Ask coding questions

← Back to all posts
Cannot GET Socket.io.js
MaxwellGeringer

I am trying to use socket.io in my repl, but on the client side it tells me Cannot GET /socket.io/socket.io.js. The only solution I could find is to switch from using app.listen to http.listen but I have already done that but the same result occurs.

Answered by ruiwenge2 [earned 5 cycles]
View Answer
Voters
MaxwellGeringer
Comments
hotnewtop
ruiwenge2

do this:

MaxwellGeringer

@ruiwenge2 Hmm, I tried that but it tells me that http.listen is not a function. I switched it to app.listen but it still gives me the Cannot GET error.

ruiwenge2

@MaxwellGeringer you can take a look at my chat website: https://replit.com/@ruiwenge2/Chat

it uses socket.io. maybe it will help

ruiwenge2

@MaxwellGeringer use server.listen.

MaxwellGeringer

@ruiwenge2 That worked! Thanks!

ruiwenge2