Skip to content

Commit

Permalink
README: simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
rauchg committed Dec 25, 2013
1 parent 39d5e20 commit 35523da
Showing 1 changed file with 16 additions and 27 deletions.
43 changes: 16 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,26 @@

## How to use

### Standalone

A standalone build of `socket.io-client` is exposed automatically by the
socket.io server as `/socket.io/socket.io.js`. Alternatively you can
serve the file `socket.io-client.js` found at the root of this repository.

```html
<script src="/socket.io/socket.io.js"></script>
<script>
var socket = io('http://localhost');
socket.on('connect', function(){
socket.on('event', function(data){});
socket.on('disconnect', function(){});
});
</script>
```

### Component

Socket.IO is a [component](http://github.com/component/component), which
means you can include it by using `require` on the browser:

```js
var socket = require('socket.io')('http://localhost');
A standalone build of `socket.io-client` is exposed automatically by the
socket.io server as `/socket.io/socket.io.js`. Alternatively you can
serve the file `socket.io.js` found at the root of this repository.

```html
<script src="/socket.io/socket.io.js"></script>
<script>
var socket = io('http://localhost');
socket.on('connect', function(){
socket.on('event', function(data){});
socket.on('disconnect', fucntion(){});
socket.on('disconnect', function(){});
});
```
</script>
```

Socket.IO is also compatible with
[component](http://github.com/component/component) and
[browserify](http://github.com/substack/browserify).

### Node.JS
### Node.JS (server-side usage)

Add `socket.io-client` to your `package.json` and then:

Expand Down

0 comments on commit 35523da

Please sign in to comment.