Skip to content

Commit 1aef180

Browse files
committed
Merge pull request #652 from JacksonTian/browser
remove the browserify users section
2 parents 9dc7e6b + 724bd02 commit 1aef180

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

README.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ compiler is installed on the host system.
3131

3232
- `npm install --save bufferutil`: Improves internal buffer operations which
3333
allows for faster processing of masked WebSocket frames and general buffer
34-
operations.
34+
operations.
3535
- `npm install --save utf-8-validate`: The specification requires validation of
3636
invalid UTF-8 chars, some of these validations could not be done in JavaScript
3737
hence the need for a binary addon. In most cases you will already be
@@ -110,7 +110,7 @@ wss.on('connection', function connection(ws) {
110110
var location = url.parse(ws.upgradeReq.url, true);
111111
// you might use location.query.access_token to authenticate or share sessions
112112
// or ws.upgradeReq.headers.cookie (see http://stackoverflow.com/a/16395220/151312)
113-
113+
114114
ws.on('message', function incoming(message) {
115115
console.log('received: %s', message);
116116
});
@@ -161,7 +161,7 @@ catch (e) { /* handle error */ }
161161
```js
162162
var WebSocket = require('ws');
163163
var ws = new WebSocket('ws://echo.websocket.org/', {
164-
protocolVersion: 8,
164+
protocolVersion: 8,
165165
origin: 'http://websocket.org'
166166
});
167167

@@ -183,13 +183,6 @@ ws.on('message', function message(data, flags) {
183183
});
184184
```
185185

186-
### Browserify users
187-
When including ws via a browserify bundle, ws returns global.WebSocket which has slightly different API.
188-
You should use the standard WebSockets API instead.
189-
190-
https://developer.mozilla.org/en-US/docs/WebSockets/Writing_WebSocket_client_applications#Availability_of_WebSockets
191-
192-
193186
### Other examples
194187

195188
For a full example with a browser client communicating with a ws server, see the

0 commit comments

Comments
 (0)