add @discordjs/opus + jmd.js

This commit is contained in:
2021-04-11 12:12:39 +02:00
parent c49adbb146
commit 5c2e0737c0
977 changed files with 199471 additions and 1074 deletions

View File

@@ -376,12 +376,16 @@ class PerMessageDeflate {
this._inflate[kTotalLength]
);
if (fin && this.params[`${endpoint}_no_context_takeover`]) {
if (this._inflate._readableState.endEmitted) {
this._inflate.close();
this._inflate = null;
} else {
this._inflate[kTotalLength] = 0;
this._inflate[kBuffers] = [];
if (fin && this.params[`${endpoint}_no_context_takeover`]) {
this._inflate.reset();
}
}
callback(null, data);
@@ -448,12 +452,11 @@ class PerMessageDeflate {
//
this._deflate[kCallback] = null;
this._deflate[kTotalLength] = 0;
this._deflate[kBuffers] = [];
if (fin && this.params[`${endpoint}_no_context_takeover`]) {
this._deflate.close();
this._deflate = null;
} else {
this._deflate[kTotalLength] = 0;
this._deflate[kBuffers] = [];
this._deflate.reset();
}
callback(null, data);

View File

@@ -225,7 +225,7 @@ class WebSocketServer extends EventEmitter {
const info = {
origin:
req.headers[`${version === 8 ? 'sec-websocket-origin' : 'origin'}`],
secure: !!(req.connection.authorized || req.connection.encrypted),
secure: !!(req.socket.authorized || req.socket.encrypted),
req
};

2
node_modules/ws/lib/websocket.js generated vendored
View File

@@ -695,7 +695,7 @@ function tlsConnect(options) {
options.path = undefined;
if (!options.servername && options.servername !== '') {
options.servername = options.host;
options.servername = net.isIP(options.host) ? '' : options.host;
}
return tls.connect(options);