Where is the socket.io client library?

Braun Shedd picture Braun Shedd · Dec 16, 2011 · Viewed 39.3k times · Source

As far as I have seen, there is no explanation as to where we are to locate the client side script for socket.io if node.js is not used as the web server. I've found a whole directory of client side files, but I need them in a combined version (like it's served when using node.js webs servers). Any ideas?

Answer

Matt Way picture Matt Way · Nov 18, 2013

The best way I have found to do this is to use bower.

bower install socket.io-client --save

and include the following in your app's HTML:

<script src="/bower_components/socket.io-client/socket.io.js"></script>

That way you can treat the socket.io part of your client the same way you treat any other managed package.