Skip to content

Commit

Permalink
Fixed readme
Browse files Browse the repository at this point in the history
  • Loading branch information
rauchg committed Jun 21, 2011
1 parent 2838f25 commit 159ad73
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions Readme.md
Expand Up @@ -9,9 +9,6 @@ horizontal scalability, automatic JSON encoding/decoding, and more.

npm install socket.io

**Note:** this is the documentation for the upcoming release **0.7**. The latest
tag on NPM is [0.6](https://github.com/LearnBoost/Socket.IO-node/tree/06).

## How to use

First, require `socket.io`:
Expand All @@ -30,7 +27,10 @@ var app = express.createServer();
app.listen(80);

io.sockets.on('connection', function (socket) {
socket.send({ hello: 'world' });
socket.emit('news', { hello: 'world' });
socket.on('my other event', function (data) {
console.log(data);
});
});
```

Expand All @@ -40,8 +40,9 @@ Finally, load it from the client side code:
<script src="/socket.io/socket.io.js"></script>
<script>
var socket = io.connect('http://localhost');
socket.on('news', function () {
socket.emit('myOtherEvent', { my: 'data' });
socket.on('news', function (data) {
console.log(data);
socket.emit('my other event', { my: 'data' });
});
</script>
```
Expand Down Expand Up @@ -318,8 +319,6 @@ io.configure('development', function () {
});
```
## [API docs](http://socket.io/api.html)
## License
(The MIT License)
Expand Down

0 comments on commit 159ad73

Please sign in to comment.