refactor: better proxy handling

This commit is contained in:
zhom
2025-08-13 11:19:31 +04:00
parent 59c69c44a1
commit a14da3d2f0
4 changed files with 125 additions and 24 deletions
+2 -4
View File
@@ -57,10 +57,8 @@ program
// Build upstream URL from individual components if provided
if (options.host && options.proxyPort && options.type) {
const protocol =
options.type === "socks4" || options.type === "socks5"
? options.type
: "http";
// Preserve provided scheme (http, https, socks4, socks5)
const protocol = String(options.type).toLowerCase();
const auth =
options.username && options.password
? `${encodeURIComponent(options.username)}:${encodeURIComponent(