Comparing version 9.14.0 to 9.147.0
{ | ||
"name": "uws", | ||
"version": "9.14.0", | ||
"version": "9.147.0", | ||
"scripts": { | ||
@@ -16,3 +16,3 @@ "install": "node-gyp rebuild > build_log.txt 2>&1 || exit 0" | ||
], | ||
"homepage": "https://github.com/uWebSockets/uWebSockets", | ||
"homepage": "https://github.com/uNetworking/uWebSockets", | ||
"license": "Zlib", | ||
@@ -22,4 +22,4 @@ "author": "Alex Hultman <alexhultman@gmail.com> (https://github.com/alexhultman)", | ||
"type": "git", | ||
"url": "https://github.com/uWebSockets/uWebSockets.git" | ||
"url": "https://github.com/uNetworking/uWebSockets.git" | ||
} | ||
} |
@@ -0,1 +1,16 @@ | ||
# UWS IS *NOT* AN ELECTRON MODULE | ||
`uws` is a replacement module for `ws` which allows, but doesn't guarantee (certainly not when paired with Socket.IO), significant performance and memory-usage improvements. This module is specifically *only* compatible with Node.js and is installed *only* like so: | ||
`npm install uws` | ||
* uws *can* use node-gyp and *can* recompile itself at installation but does *not* require so. | ||
* npm installation never fails, but `require('uws')` will throw if all of the below points hold true: | ||
* There was no C++11 compiler available at installation. | ||
* Your system is not an official **Tier 1** Node.js platform. | ||
## Keep in mind | ||
You can't fix a clogged up system by only fixing part of the problem. Swapping to uws can have *dramatical* effects if your entire pipeline works well. Socket.IO, SocketCluster and other such mass bloat will **not** give you desired results as those projects already, from the start, **are** the bottleneck. | ||
[Read more about other horrible Node.js projects here](https://github.com/alexhultman/The-Node.js-performance-palette) | ||
## Usage | ||
@@ -26,8 +41,1 @@ `uws` tries to mimic `ws` as closely as possible without sacrificing too much performance. In most cases you simply swap `require('ws')` with `require('uws')`: | ||
* `webSocket.upgradeReq` is only valid during execution of the connection handler. If you want to keep properties of the upgradeReq for the entire lifetime of the webSocket you better attach that specific property to the webSocket at connection. | ||
## Installation | ||
[![](https://nodei.co/npm/uws.png)](https://www.npmjs.com/package/uws) | ||
At installation `uws` will try to recompile itself using the system's C++11 compiler (GCC 4.8+, Clang 3.3, VC++ 2015+). | ||
If this fails it will silently fall back to using the precompiled binaries. | ||
NPM installation will never fail but `require('uws')` will throw if it cannot properly load the binary module. |
18
uws.js
@@ -8,2 +8,4 @@ 'use strict'; | ||
let _upgradeReq = null; | ||
function noop() {} | ||
@@ -16,3 +18,3 @@ | ||
function emitConnection(ws) { | ||
this.emit('connection', ws); | ||
this.emit('connection', ws, _upgradeReq); | ||
} | ||
@@ -48,4 +50,2 @@ | ||
var _upgradeReq = null; | ||
const clientGroup = native.client.group.create(0, DEFAULT_PAYLOAD_LIMIT); | ||
@@ -278,3 +278,3 @@ | ||
if (this.external) { | ||
native.server.send(this.external, message, WebSocketClient.OPCODE_PING); | ||
native.server.send(this.external, message, WebSocketClient.OPCODE_PING, false); | ||
} | ||
@@ -290,3 +290,3 @@ } | ||
send(message, options, cb) { | ||
send(message, options, cb, compress) { | ||
if (this.external) { | ||
@@ -302,3 +302,3 @@ if (typeof options === 'function') { | ||
process.nextTick(cb); | ||
}) : undefined); | ||
}) : undefined, compress); | ||
} else if (cb) { | ||
@@ -327,3 +327,3 @@ cb(new Error('not opened')); | ||
if (this.external) { | ||
native.client.send(this.external, message, WebSocketClient.OPCODE_PING); | ||
native.client.send(this.external, message, WebSocketClient.OPCODE_PING, false); | ||
} | ||
@@ -339,3 +339,3 @@ } | ||
send(message, options, cb) { | ||
send(message, options, cb, compress) { | ||
if (this.external) { | ||
@@ -351,3 +351,3 @@ if (typeof options === 'function') { | ||
process.nextTick(cb); | ||
}) : undefined); | ||
}) : undefined, compress); | ||
} else if (cb) { | ||
@@ -354,0 +354,0 @@ cb(new Error('not opened')); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 16 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41
14449602
18