XMen
XMen

Reputation: 30248

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

Upvotes: 12

Views: 11536

Answers (3)

AmpT
AmpT

Reputation: 2584

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

Upvotes: 2

generalhenry
generalhenry

Reputation: 17319

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

Upvotes: 16

Joe Zim
Joe Zim

Reputation: 1967

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.

Upvotes: 18

Related Questions