fosscord-server/pulls/858
This commit is contained in:
@@ -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) => {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user