mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
build(peer-deps): use uws fork backport (#2782)
* build(peer-deps): uws backport * chore: update to 149 for uws
This commit is contained in:
@@ -44,7 +44,7 @@ For production bots, using node-opus should be considered a necessity, especiall
|
||||
- One of the following packages can be installed for faster voice packet encryption and decryption:
|
||||
- [sodium](https://www.npmjs.com/package/sodium) (`npm install sodium`)
|
||||
- [libsodium.js](https://www.npmjs.com/package/libsodium-wrappers) (`npm install libsodium-wrappers`)
|
||||
- [uws](https://www.npmjs.com/package/uws) for a much faster WebSocket connection (`npm install uws`)
|
||||
- [uws](https://www.npmjs.com/package/@discordjs/uws) for a much faster WebSocket connection (`npm install @discordjs/uws`)
|
||||
|
||||
## Example usage
|
||||
```js
|
||||
|
||||
@@ -52,7 +52,7 @@ For production bots, using node-opus should be considered a necessity, especiall
|
||||
- One of the following packages can be installed for faster voice packet encryption and decryption:
|
||||
- [sodium](https://www.npmjs.com/package/sodium) (`npm install sodium`)
|
||||
- [libsodium.js](https://www.npmjs.com/package/libsodium-wrappers) (`npm install libsodium-wrappers`)
|
||||
- [uws](https://www.npmjs.com/package/uws) for a much faster WebSocket connection (`npm install uws`)
|
||||
- [uws](https://www.npmjs.com/package/@discordjs/uws) for a much faster WebSocket connection (`npm install @discordjs/uws`)
|
||||
|
||||
## Example usage
|
||||
```js
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
"node-opus": "^0.2.7",
|
||||
"opusscript": "^0.0.6",
|
||||
"sodium": "^2.0.3",
|
||||
"uws": "<=10.148.1"
|
||||
"@discordjs/uws": "^10.149.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^9.4.6",
|
||||
@@ -65,6 +65,7 @@
|
||||
"browser": {
|
||||
"ws": false,
|
||||
"uws": false,
|
||||
"@discordjs/uws": false,
|
||||
"erlpack": false,
|
||||
"prism-media": false,
|
||||
"opusscript": false,
|
||||
|
||||
@@ -4,7 +4,7 @@ const EventEmitter = require('events').EventEmitter;
|
||||
|
||||
let WebSocket;
|
||||
try {
|
||||
WebSocket = require('uws');
|
||||
WebSocket = require('@discordjs/uws');
|
||||
} catch (err) {
|
||||
WebSocket = require('ws');
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ const erlpack = (function findErlpack() {
|
||||
const WebSocket = (function findWebSocket() {
|
||||
if (browser) return window.WebSocket; // eslint-disable-line no-undef
|
||||
try {
|
||||
return require('uws');
|
||||
return require('@discordjs/uws');
|
||||
} catch (e) {
|
||||
return require('ws');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user