chat-example icon indicating copy to clipboard operation
chat-example copied to clipboard

How to include socket.io.js (client) file in html?

Open parth-vora-7 opened this issue 9 years ago • 2 comments

Hello,

I want to include socket.io.js (client) file into index.html without using CDN. I have put socket.io.js into project's root directory. But when I'm trying to open the chat on browser, I'm getting 404 for that file. Here is my cod to include that file:

File have full permission.

Thanks

parth-vora-7 avatar May 24 '16 15:05 parth-vora-7

I had the same issue when I was using this along with Express. I was starting the server with app.listen() instead of http.listen(). Once I changed it the 404 error went away.

bradbyte avatar Jul 11 '16 17:07 bradbyte

add this line to the server to start serving static file such as the file socket.io.js : app.use(express.static([put the path where your static files exists ])).

spike442 avatar Oct 31 '16 03:10 spike442