Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ The socket.io middleware that powers [socket.io-p2p](https://github.com/tomcartw

Simple require the module and [use]("http://socket.io/docs/server-api/#namespace#use(fn:function):namespace") it.

```
```javascript
var p2pserver = require('socket.io-p2p-server').Server
var io = require('socket.io')(server);
io.use(p2pserver)
```

For example, in an express powered app, you can do the following:

```
```javascript
var app = require('express')()
var server = require('http').Server(app)
var p2pserver = require('socket.io-p2p-server').Server
Expand All @@ -31,7 +31,7 @@ server.listen(3030, function () {

It can also be used inside your connection logic so that you can specify a room that clients will communicate over:

```
```javascript
p2pserver(socket, null, room)
```

Expand Down