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.
This commit is contained in:
Ruize Tang 2024-04-09 22:07:13 +08:00
commit c1c9416e3a

View file

@ -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).