fosscord-server/pulls/858

This commit is contained in:
Madeline
2022-08-21 17:35:04 +10:00
parent 3b16a496d4
commit 7ce8543510
25 changed files with 411 additions and 223 deletions
+1 -3
View File
@@ -14,9 +14,7 @@ export function Send(socket: WebSocket, data: Payload) {
else return;
// TODO: compression
if (socket.deflate) {
socket.deflate.write(buffer);
socket.deflate.flush();
return;
buffer = socket.deflate.process(buffer) as Buffer;
}
return new Promise((res, rej) => {
+2 -1
View File
@@ -1,6 +1,6 @@
import { Intents, Permissions } from "@fosscord/util";
import WS from "ws";
import { Deflate } from "zlib";
import { Deflate, Inflate } from "fast-zlib";
export interface WebSocket extends WS {
version: number;
@@ -11,6 +11,7 @@ export interface WebSocket extends WS {
shard_count?: bigint;
shard_id?: bigint;
deflate?: Deflate;
inflate?: Inflate;
heartbeatTimeout: NodeJS.Timeout;
readyTimeout: NodeJS.Timeout;
intents: Intents;