Proxy TLS sockets

This commit is contained in:
Asher
2019-07-30 17:20:53 -05:00
parent 8ded89e8d4
commit 011530e11b
2 changed files with 87 additions and 6 deletions

View File

@@ -1,5 +1,4 @@
import * as cp from "child_process";
import * as tls from "tls";
import { getPathFromAmdModule } from "vs/base/common/amd";
import { VSBuffer } from "vs/base/common/buffer";
@@ -62,8 +61,9 @@ export class ExtensionHostConnection extends Connection {
public constructor(protocol: Protocol, buffer: VSBuffer, private readonly log: ILogService) {
super(protocol);
protocol.dispose();
this.protocol.dispose();
this.process = this.spawn(buffer);
this.protocol.getUnderlyingSocket().pause();
}
protected dispose(): void {
@@ -89,7 +89,7 @@ export class ExtensionHostConnection extends Connection {
type: "VSCODE_EXTHOST_IPC_SOCKET",
initialDataChunk: (buffer.buffer as Buffer).toString("base64"),
skipWebSocketFrames: this.protocol.getSocket() instanceof NodeSocket,
}, socket instanceof tls.TLSSocket ? (<any>socket)._parent : socket);
}, socket);
}
private spawn(buffer: VSBuffer): cp.ChildProcess {