another attempt
This commit is contained in:
parent
117ff56d1e
commit
a984733b9b
3 changed files with 25 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue