Comparing version 10.148.1 to 10.148.2
{ | ||
"name": "uws", | ||
"version": "10.148.1", | ||
"main": "uws.js", | ||
"description": "Tiny WebSockets", | ||
"engines": { | ||
"node": ">=8" | ||
}, | ||
"keywords": [ | ||
"tiny", | ||
"websockets" | ||
], | ||
"homepage": "https://github.com/uNetworking/uWebSockets", | ||
"license": "Zlib", | ||
"author": "Alex Hultman <alexhultman@gmail.com> (https://github.com/alexhultman)", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/uNetworking/uWebSockets.git" | ||
} | ||
"version": "10.148.2" | ||
} |
@@ -1,40 +0,1 @@ | ||
# 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 | ||
`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')`: | ||
```javascript | ||
var WebSocketServer = require('uws').Server; | ||
var wss = new WebSocketServer({ port: 3000 }); | ||
function onMessage(message) { | ||
console.log('received: ' + message); | ||
} | ||
wss.on('connection', function(ws) { | ||
ws.on('message', onMessage); | ||
ws.send('something'); | ||
}); | ||
``` | ||
##### Deviations from ws | ||
There are some important incompatibilities with `ws` though, we aim to be ~90% compatible but will never implement behavior that is deemed too inefficient: | ||
* Binary data is passed zero-copy as an `ArrayBuffer`. This means you need to copy it to keep it past the callback. It also means you need to convert it with `Buffer.from(message)` if you expect a `Node.js Buffer`. | ||
* `webSocket._socket` is not a `net.Socket`, it is just a getter function with very basic functionalities. | ||
* `webSocket._socket.remote...` might fail, you need to cache it at connection. | ||
* `webSocket` acts like an `EventEmitter` with one listener per event maximum. | ||
* `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. | ||
# I no longer publish to NPM. Find me elsewhere. |
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
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No License Found
License(Experimental) License information could not be found.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance 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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 6 instances in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
2
93
2
1
0
2
1
1