@@ -4,16 +4,15 @@ import * as path from "path"
4
4
import * as tls from "tls"
5
5
import { Emitter } from "../common/emitter"
6
6
import { generateUuid } from "../common/util"
7
- import { tmpdir } from "./constants"
8
- import { canConnect } from "./util"
7
+ import { canConnect , paths } from "./util"
9
8
10
9
/**
11
10
* Provides a way to proxy a TLS socket. Can be used when you need to pass a
12
11
* socket to a child process since you can't pass the TLS socket.
13
12
*/
14
13
export class SocketProxyProvider {
15
14
private readonly onProxyConnect = new Emitter < net . Socket > ( )
16
- private proxyPipe = path . join ( tmpdir , "tls-proxy" )
15
+ private proxyPipe = path . join ( paths . runtime , "tls-proxy" )
17
16
private _proxyServer ?: Promise < net . Server >
18
17
private readonly proxyTimeout = 5000
19
18
@@ -76,7 +75,10 @@ export class SocketProxyProvider {
76
75
this . _proxyServer = this . findFreeSocketPath ( this . proxyPipe )
77
76
. then ( ( pipe ) => {
78
77
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
+ ] )
80
82
} )
81
83
. then ( ( ) => {
82
84
return new Promise ( ( resolve ) => {
0 commit comments