mirror of
https://github.com/sammwyy/MikuMikuBeam.git
synced 2025-07-01 19:13:02 +00:00
Update clientUtils.js
i add to accept expired/invalid SSL certificates
This commit is contained in:
parent
7707d29a2a
commit
6503ca6eed
@ -14,7 +14,13 @@ export function createAgent(proxy) {
|
|||||||
: ""
|
: ""
|
||||||
}${proxy.host}:${proxy.port}`;
|
}${proxy.host}:${proxy.port}`;
|
||||||
|
|
||||||
return new SocksProxyAgent(uri);
|
// return new SocksProxyAgent(uri);
|
||||||
|
return new SocksProxyAgent({
|
||||||
|
hostname: proxy.host,
|
||||||
|
port: proxy.port,
|
||||||
|
protocol: proxy.protocol + ":",
|
||||||
|
rejectUnauthorized: false,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// HTTP Client
|
// HTTP Client
|
||||||
@ -58,6 +64,11 @@ export function createHttpClient(
|
|||||||
config.proxy = false;
|
config.proxy = false;
|
||||||
config.httpAgent = agent;
|
config.httpAgent = agent;
|
||||||
config.httpsAgent = agent;
|
config.httpsAgent = agent;
|
||||||
|
|
||||||
|
// Just to be extra sure
|
||||||
|
if (config.httpsAgent?.options) {
|
||||||
|
config.httpsAgent.options.rejectUnauthorized = false;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"Unsupported proxy protocol for HTTP client: " + proxy.protocol
|
"Unsupported proxy protocol for HTTP client: " + proxy.protocol
|
||||||
|
Loading…
Reference in New Issue
Block a user