mirror of
https://github.com/koichixD/uptime-kuma.git
synced 2026-08-28 22:01:05 +00:00
feat(proxy): allow socks proxy for the notifications (#7088)
This commit is contained in:
@@ -2,6 +2,7 @@ const { Liquid } = require("liquidjs");
|
||||
const { DOWN } = require("../../src/util");
|
||||
const { HttpProxyAgent } = require("http-proxy-agent");
|
||||
const { HttpsProxyAgent } = require("https-proxy-agent");
|
||||
const { SocksProxyAgent } = require("socks-proxy-agent");
|
||||
|
||||
class NotificationProvider {
|
||||
/**
|
||||
@@ -183,6 +184,10 @@ class NotificationProvider {
|
||||
const agent = new HttpsProxyAgent(proxyEnv);
|
||||
axiosConfig.httpAgent = agent;
|
||||
axiosConfig.httpsAgent = agent;
|
||||
} else if (["socks:", "socks4:", "socks5:", "socks5h:"].includes(proxyUrl.protocol)) {
|
||||
const agent = new SocksProxyAgent(proxyEnv);
|
||||
axiosConfig.httpAgent = agent;
|
||||
axiosConfig.httpsAgent = agent;
|
||||
}
|
||||
|
||||
axiosConfig.proxy = false;
|
||||
|
||||
Reference in New Issue
Block a user