mirror of
https://github.com/sammwyy/MikuMikuBeam.git
synced 2025-06-30 18:43:01 +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}`;
|
||||
|
||||
return new SocksProxyAgent(uri);
|
||||
// return new SocksProxyAgent(uri);
|
||||
return new SocksProxyAgent({
|
||||
hostname: proxy.host,
|
||||
port: proxy.port,
|
||||
protocol: proxy.protocol + ":",
|
||||
rejectUnauthorized: false,
|
||||
});
|
||||
}
|
||||
|
||||
// HTTP Client
|
||||
@ -58,6 +64,11 @@ export function createHttpClient(
|
||||
config.proxy = false;
|
||||
config.httpAgent = agent;
|
||||
config.httpsAgent = agent;
|
||||
|
||||
// Just to be extra sure
|
||||
if (config.httpsAgent?.options) {
|
||||
config.httpsAgent.options.rejectUnauthorized = false;
|
||||
}
|
||||
} else {
|
||||
throw new Error(
|
||||
"Unsupported proxy protocol for HTTP client: " + proxy.protocol
|
||||
|
Loading…
Reference in New Issue
Block a user