Skip to content

How do I serve the client

guille edited this page Mar 1, 2012 · 5 revisions

The client is served automatically by the Node.JS server. In your <head> tag of your HTML, include:

<script src="http://<uri:port>/socket.io/socket.io.js"></script>

If your web app and socket.io are on the same server and port, you can simply include:

<script src="/socket.io/socket.io.js"></script>

Socket.io client can also include optional version numbers, in order to maximize caching performance. You can simply include the version number within javascript filename;

<script src="/socket.io/socket.io.v0.0.1.js"></script>

If you choose to serve the client through other means, you can clone the socket.io-client repository and look at the dist/ subdirectory.

Clone this wiki locally