I want to download socket.io 0.7 client file , i got the server file but not getting from where should i get client f开发者_C百科ile.
Please suggest
That answer sorta helped point me in the right direction. If you're using NPM, just use
npm install socket.io-client
Then go into node_modules/socket.io-client/bin and run
node builder
Then go to ../dist and the built JavaScript files will be there.
It's kinda ridiculous that a Google search for "download socket.io" never produced any results. Nothing ever pointed me to the client project, so I didn't even realize they were 2 separate projects. I'm surprised I even figured out the builder process. You could also go to the folder that the above guy mentioned and download them manually. So old school. :P
EDIT: There is another way as I wrote on my blog: http://www.joezimjs.com/javascript/plugging-into-socket-io-the-basics/
If you are using Node.js for your back end (possibly other back ends too, I don't really know), then the file is already available through the Socket.IO server. Just add a script tag:
<script src="http://<uri:port>/socket.io/socket.io.js"></script>
<uri:port>
refers to the same URI and Port that you use to connect to your Socket.IO server. BAM! No extra downloads or installation for ya. These things should really be made more evident in the documentation and online guides.
They're in the socket.io-client package that installs along with socket.io if you use NPM. You can also get the files off github: https://github.com/LearnBoost/socket.io-client
Latest socket.io.js client file as of today (minified):
http://cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.16/socket.io.min.js
精彩评论