Update README.md
This commit is contained in:
parent
2fd16eaac4
commit
bfe68af4e1
1 changed files with 6 additions and 7 deletions
13
node_modules/ws/README.md
generated
vendored
13
node_modules/ws/README.md
generated
vendored
|
@ -1,9 +1,8 @@
|
||||||
# ws: a Node.js WebSocket library
|
# ws: a Node.js WebSocket library
|
||||||
|
|
||||||
[](https://www.npmjs.com/package/ws)
|
[](https://www.npmjs.com/package/ws)
|
||||||
[](https://travis-ci.com/websockets/ws)
|
[](https://github.com/websockets/ws/actions?query=workflow%3ACI+branch%3Amaster)
|
||||||
[](https://ci.appveyor.com/project/lpinca/ws)
|
[](https://coveralls.io/github/websockets/ws)
|
||||||
[](https://coveralls.io/github/websockets/ws)
|
|
||||||
|
|
||||||
ws is a simple to use, blazing fast, and thoroughly tested WebSocket client and
|
ws is a simple to use, blazing fast, and thoroughly tested WebSocket client and
|
||||||
server implementation.
|
server implementation.
|
||||||
|
@ -23,7 +22,7 @@ can use one of the many wrappers available on npm, like
|
||||||
|
|
||||||
- [Protocol support](#protocol-support)
|
- [Protocol support](#protocol-support)
|
||||||
- [Installing](#installing)
|
- [Installing](#installing)
|
||||||
- [Opt-in for performance and spec compliance](#opt-in-for-performance-and-spec-compliance)
|
- [Opt-in for performance](#opt-in-for-performance)
|
||||||
- [API docs](#api-docs)
|
- [API docs](#api-docs)
|
||||||
- [WebSocket compression](#websocket-compression)
|
- [WebSocket compression](#websocket-compression)
|
||||||
- [Usage examples](#usage-examples)
|
- [Usage examples](#usage-examples)
|
||||||
|
@ -56,7 +55,7 @@ can use one of the many wrappers available on npm, like
|
||||||
npm install ws
|
npm install ws
|
||||||
```
|
```
|
||||||
|
|
||||||
### Opt-in for performance and spec compliance
|
### Opt-in for performance
|
||||||
|
|
||||||
There are 2 optional modules that can be installed along side with the ws
|
There are 2 optional modules that can be installed along side with the ws
|
||||||
module. These modules are binary addons which improve certain operations.
|
module. These modules are binary addons which improve certain operations.
|
||||||
|
@ -67,7 +66,7 @@ necessarily need to have a C++ compiler installed on your machine.
|
||||||
operations such as masking and unmasking the data payload of the WebSocket
|
operations such as masking and unmasking the data payload of the WebSocket
|
||||||
frames.
|
frames.
|
||||||
- `npm install --save-optional utf-8-validate`: Allows to efficiently check if a
|
- `npm install --save-optional utf-8-validate`: Allows to efficiently check if a
|
||||||
message contains valid UTF-8 as required by the spec.
|
message contains valid UTF-8.
|
||||||
|
|
||||||
## API docs
|
## API docs
|
||||||
|
|
||||||
|
@ -395,7 +394,7 @@ the `X-Forwarded-For` header.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
wss.on('connection', function connection(ws, req) {
|
wss.on('connection', function connection(ws, req) {
|
||||||
const ip = req.headers['x-forwarded-for'].split(/\s*,\s*/)[0];
|
const ip = req.headers['x-forwarded-for'].split(',')[0].trim();
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue