@@ -4,16 +4,15 @@ import * as path from "path"
44import * as tls from "tls"
55import { Emitter } from "../common/emitter"
66import { generateUuid } from "../common/util"
7- import { tmpdir } from "./constants"
8- import { canConnect } from "./util"
7+ import { canConnect , paths } from "./util"
98
109/**
1110 * Provides a way to proxy a TLS socket. Can be used when you need to pass a
1211 * socket to a child process since you can't pass the TLS socket.
1312 */
1413export class SocketProxyProvider {
1514 private readonly onProxyConnect = new Emitter < net . Socket > ( )
16- private proxyPipe = path . join ( tmpdir , "tls-proxy" )
15+ private proxyPipe = path . join ( paths . runtime , "tls-proxy" )
1716 private _proxyServer ?: Promise < net . Server >
1817 private readonly proxyTimeout = 5000
1918
@@ -76,7 +75,10 @@ export class SocketProxyProvider {
7675 this . _proxyServer = this . findFreeSocketPath ( this . proxyPipe )
7776 . then ( ( pipe ) => {
7877 this . proxyPipe = pipe
79- return Promise . all ( [ fs . mkdir ( tmpdir , { recursive : true } ) , fs . rmdir ( this . proxyPipe , { recursive : true } ) ] )
78+ return Promise . all ( [
79+ fs . mkdir ( paths . runtime , { recursive : true } ) ,
80+ fs . rmdir ( this . proxyPipe , { recursive : true } ) ,
81+ ] )
8082 } )
8183 . then ( ( ) => {
8284 return new Promise ( ( resolve ) => {
0 commit comments