Skip to content

Commit

Permalink
Readme update for ws v2.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcollina committed Apr 5, 2017
1 parent d6dff7a commit 372725d
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ Always convert to `Buffer` in Node.js before sending.

Default: `true`

##### `options.perMessageDeflate`

We recommend disabling the [per message deflate
extension](https://tools.ietf.org/html/rfc7692) to achieve the best
throughput.

Default: `false`

##### Other options

When used in node.js see the [ws.WebSocket documentation](https://github.com/websockets/ws/blob/master/doc/ws.md#class-wswebsocket)
Expand All @@ -57,6 +65,22 @@ function handle(stream) {
}
```

We recommend disabling the [per message deflate
extension](https://tools.ietf.org/html/rfc7692) to achieve the best
throughput:

```javascript
var websocket = require('websocket-stream')
var wss = websocket.createServer({
perMessageDeflate: false,
server: someHTTPServer
}, handle)

function handle(stream) {
fs.createReadStream('bigdata.json').pipe(stream)
}
```

## Run the tests

### Server-side tests
Expand Down

0 comments on commit 372725d

Please sign in to comment.