Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get socket.io 0.7 client file

I want to download socket.io 0.7 client file , i got the server file but not getting from where should i get client file.

Please suggest

like image 664
XMen Avatar asked Jul 05 '11 18:07

XMen


1 Answers

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.

like image 58
Joe Zim Avatar answered Nov 16 '22 02:11

Joe Zim