Skip to content

Commit 159ad73

Browse files
committed
Fixed readme
1 parent 2838f25 commit 159ad73

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

Readme.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ horizontal scalability, automatic JSON encoding/decoding, and more.
99

1010
npm install socket.io
1111

12-
**Note:** this is the documentation for the upcoming release **0.7**. The latest
13-
tag on NPM is [0.6](https://github.com/LearnBoost/Socket.IO-node/tree/06).
14-
1512
## How to use
1613

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

3229
io.sockets.on('connection', function (socket) {
33-
socket.send({ hello: 'world' });
30+
socket.emit('news', { hello: 'world' });
31+
socket.on('my other event', function (data) {
32+
console.log(data);
33+
});
3434
});
3535
```
3636

@@ -40,8 +40,9 @@ Finally, load it from the client side code:
4040
<script src="/socket.io/socket.io.js"></script>
4141
<script>
4242
var socket = io.connect('http://localhost');
43-
socket.on('news', function () {
44-
socket.emit('myOtherEvent', { my: 'data' });
43+
socket.on('news', function (data) {
44+
console.log(data);
45+
socket.emit('my other event', { my: 'data' });
4546
});
4647
</script>
4748
```
@@ -318,8 +319,6 @@ io.configure('development', function () {
318319
});
319320
```
320321
321-
## [API docs](http://socket.io/api.html)
322-
323322
## License
324323
325324
(The MIT License)

0 commit comments

Comments
 (0)