Fix proxy conflict
This commit is contained in:
parent
b6eb8de3a0
commit
cda0351a2b
|
@ -177,7 +177,14 @@ export function generateRequestStream (url: string, options: PeerTubeRequestOpti
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getProxyAgent () {
|
export function getProxyAgent () {
|
||||||
if (!isProxyEnabled()) return {}
|
if (!isProxyEnabled()) {
|
||||||
|
return {
|
||||||
|
agent: { // Fix issue https://github.com/node-fetch/node-fetch/issues/1735 with Node 20
|
||||||
|
http: new http.Agent({ keepAlive: false }),
|
||||||
|
https: new https.Agent({ keepAlive: false })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const proxy = getProxy()
|
const proxy = getProxy()
|
||||||
|
|
||||||
|
@ -230,10 +237,6 @@ function buildGotOptions (options: PeerTubeRequestOptions): OptionsOfUnknownResp
|
||||||
return {
|
return {
|
||||||
method: options.method,
|
method: options.method,
|
||||||
dnsCache: true,
|
dnsCache: true,
|
||||||
agent: { // Fix issue https://github.com/node-fetch/node-fetch/issues/1735 with Node 20
|
|
||||||
http: new http.Agent({ keepAlive: false }),
|
|
||||||
https: new https.Agent({ keepAlive: false })
|
|
||||||
},
|
|
||||||
timeout: {
|
timeout: {
|
||||||
request: options.timeout ?? REQUEST_TIMEOUTS.DEFAULT
|
request: options.timeout ?? REQUEST_TIMEOUTS.DEFAULT
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue