From f2b1d896463a68537ab422c7af59b110af47b4c4 Mon Sep 17 00:00:00 2001 From: Kiko Beats Date: Sun, 6 Jun 2021 11:03:28 +0200 Subject: [PATCH] fix: remove : from the cases --- src/agent.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/agent.ts b/src/agent.ts index 713e5a9..0ed3951 100644 --- a/src/agent.ts +++ b/src/agent.ts @@ -49,18 +49,18 @@ function parseSocksProxy( // figure out if we want socks v4 or v5, based on the "protocol" used. // Defaults to 5. if (opts.protocol) { - switch (opts.protocol) { - case 'socks4:': + switch (opts.protocol.replace(':', '')) { + case 'socks4': lookup = true; // pass through - case 'socks4a:': + case 'socks4a': type = 4; break; - case 'socks5:': + case 'socks5': lookup = true; // pass through - case 'socks:': // no version specified, default to 5h - case 'socks5h:': + case 'socks': // no version specified, default to 5h + case 'socks5h': type = 5; break; default: