Handle permessage-deflate on sockets

With this the extension host is working again.
This commit is contained in:
Asher
2021-03-02 16:42:25 -06:00
parent 150138e04b
commit 4d3d1b844d
7 changed files with 30 additions and 10 deletions

View File

@@ -10,6 +10,9 @@ export interface SocketOptions {
readonly reconnectionToken: string;
readonly reconnection: boolean;
readonly skipWebSocketFrames: boolean;
readonly permessageDeflate?: boolean;
readonly inflateBytes?: VSBuffer;
readonly recordInflateBytes?: boolean;
}
export class Protocol extends PersistentProtocol {
@@ -17,7 +20,12 @@ export class Protocol extends PersistentProtocol {
super(
options.skipWebSocketFrames
? new NodeSocket(socket)
: new WebSocketNodeSocket(new NodeSocket(socket), false, null, false),
: new WebSocketNodeSocket(
new NodeSocket(socket),
options.permessageDeflate || false,
options.inflateBytes || null,
options.recordInflateBytes || false,
),
);
}