0
0
mirror of https://github.com/sammwyy/MikuMikuBeam.git synced 2025-06-30 02:31:13 +00:00

Update clientUtils.js

i add to accept expired/invalid SSL certificates
This commit is contained in:
ripaa 2025-06-17 23:27:48 +07:00
parent 7707d29a2a
commit 6503ca6eed

View File

@ -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