Skip to content

Commit 2f4311b

Browse files
Timon0timonkurmann
andauthored
fixed proxy settings (#34)
Co-authored-by: k5t <[email protected]>
1 parent bf54d14 commit 2f4311b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

utils.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,17 +129,20 @@ module.exports = {
129129
tunnelOptions.proxy.proxyAuth = `${proxyUrl.username}:${proxyUrl.password}`;
130130
}
131131

132+
const agent = {};
132133
if (url.startsWith('https://')) {
133134
if (proxy.startsWith('https://')) {
134-
requestOptions.agent = tunnel.httpsOverHttps(tunnelOptions);
135+
agent.https = tunnel.httpsOverHttps(tunnelOptions);
135136
} else {
136-
requestOptions.agent = tunnel.httpsOverHttp(tunnelOptions);
137+
agent.https = tunnel.httpsOverHttp(tunnelOptions);
137138
}
138139
} else if (proxy.startsWith('https://')) {
139-
requestOptions.agent = tunnel.httpOverHttps(tunnelOptions);
140+
agent.http = tunnel.httpOverHttps(tunnelOptions);
140141
} else {
141-
requestOptions.agent = tunnel.httpOverHttp(tunnelOptions);
142+
agent.http = tunnel.httpOverHttp(tunnelOptions);
142143
}
144+
145+
requestOptions.agent = agent;
143146
}
144147
}
145148

0 commit comments

Comments
 (0)