diff --git a/README.md b/README.md index 5d4c115..bee7193 100644 --- a/README.md +++ b/README.md @@ -27,13 +27,13 @@ var Protocol = require('bittorrent-protocol') var net = require('net') net.createServer(function (socket) { - var wire = new Protocol() - socket.pipe(wire).pipe(socket) + var wire = new Protocol() + socket.pipe(wire).pipe(socket) // handle handshake - wire.on('handshake', function (infoHash, peerId) { - wire.handshake(new Buffer('my info hash'), new Buffer('my peer id')) - }) + wire.on('handshake', function (infoHash, peerId) { + wire.handshake(new Buffer('my info hash'), new Buffer('my peer id')) + }) }).listen(6881) ```