fix(panel-proxy): route custom geo and http(s) Telegram through panelProxy

Custom geosite/geoip downloads built their own ssrfSafeTransport and never used the configured Panel Network Proxy, so geo updates failed on servers where GitHub is filtered. Route all custom-geo HTTP (startup probes + downloads) through panelProxy when set, falling back to the direct SSRF-guarded transport otherwise; the target URL stays SSRF-validated.

The Telegram bot only honored a socks5:// panel proxy and silently rejected http(s)://, despite the setting advertising both. Branch the fasthttp dialer (FasthttpHTTPDialer for http(s), FasthttpSocksDialer for socks5) and accept all three schemes in the fallback and NewBot validation.

Add tests proving the panel proxy is used by custom geo and that the bot dialer speaks HTTP CONNECT vs SOCKS5 per scheme.
This commit is contained in:
MHSanaei
2026-06-03 14:57:49 +02:00
parent 71cf22fa8d
commit db5ce06256
8 changed files with 245 additions and 26 deletions

View File

@@ -162,7 +162,7 @@ export function createDefaultShadowsocksInboundSettings(
return {
method,
password: seed.password ?? RandomUtil.randomShadowsocksPassword(method),
network: seed.network ?? 'tcp',
network: seed.network ?? 'tcp,udp',
clients: [],
ivCheck: seed.ivCheck ?? false,
};

View File

@@ -29,7 +29,7 @@ export type ShadowsocksClient = z.infer<typeof ShadowsocksClientSchema>;
export const ShadowsocksInboundSettingsSchema = z.object({
method: SSMethodSchema.default('2022-blake3-aes-256-gcm'),
password: z.string().default(''),
network: SSNetworkSchema.default('tcp'),
network: SSNetworkSchema.default('tcp,udp'),
clients: z.array(ShadowsocksClientSchema).default([]),
ivCheck: z.boolean().default(false),
});

View File

@@ -12,7 +12,7 @@ exports[`createDefault*InboundSettings factories > shadowsocks 1`] = `
"clients": [],
"ivCheck": false,
"method": "2022-blake3-aes-256-gcm",
"network": "tcp",
"network": "tcp,udp",
"password": "ZmFrZS1zcy1zZWVk",
}
`;