another attempt

This commit is contained in:
Bojan Kucera 2025-06-06 22:37:18 -04:00
parent 117ff56d1e
commit a984733b9b
3 changed files with 25 additions and 4 deletions

View file

@ -95,9 +95,9 @@ export function validateProxyConfig(config: unknown): ProxyConfig {
const proxy = config as Record<string, unknown>;
// Validate type
if (!proxy.type || !['http', 'https', 'socks4', 'socks5'].includes(proxy.type as string)) {
throw new Error('Proxy type must be one of: http, https, socks4, socks5');
// Validate protocol
if (!proxy.protocol || !['http', 'https', 'socks4', 'socks5'].includes(proxy.protocol as string)) {
throw new Error('Proxy protocol must be one of: http, https, socks4, socks5');
}
// Validate host