From c1c9416e3a9688d12cbc32a0a60db56c522315d4 Mon Sep 17 00:00:00 2001 From: Ruize Tang <1466040111@qq.com> Date: Tue, 9 Apr 2024 22:07:13 +0800 Subject: [PATCH] fix(shell-proxy): support ssh using http proxy in cygwin the ssh-proxy.py generates `nc` commands to connect the proxy, however, in cygwin, it does not set the protocol type, leading to nc using wrong default protocol (socks5) if we actually use an http proxy. --- plugins/shell-proxy/ssh-proxy.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/shell-proxy/ssh-proxy.py b/plugins/shell-proxy/ssh-proxy.py index a498c84bc..4b692f9e4 100755 --- a/plugins/shell-proxy/ssh-proxy.py +++ b/plugins/shell-proxy/ssh-proxy.py @@ -22,7 +22,8 @@ if parsed.scheme not in proxy_protocols: def make_argv(): yield "nc" - if sys.platform == 'linux': + if sys.platform in {'linux', 'cygwin'}: + # caveats: the built-in netcat of most linux distributions and cygwin support proxy type # caveats: macOS built-in netcat command not supported proxy-type yield "-X" # --proxy-type # Supported protocols are 4 (SOCKS v4), 5 (SOCKS v5) and connect (HTTP proxy).