open-remote-ssh
open-remote-ssh copied to clipboard
socks5 support for http(s)_proxy
When installing agent on remote host, wget or curl is used to download mandatory package.
- wget is the first choice
- curl is behind
However, when the remote host rely on a socks5 proxy (defining http_proxy/https_proxy env vars):
- wget does not support socks5 protocol
- curl does
So, a fix would be to use curl:
- either curl only (no wget)
- or curl as a first choice (before wget check)
Before (KO):
if [[ ! -z $(which wget) ]]; then
wget --tries=3 --timeout=10 --continue --no-verbose -O vscode-server.tar.gz $SERVER_DOWNLOAD_URL
elif [[ ! -z $(which curl) ]]; then
curl --retry 3 --connect-timeout 10 --location --show-error --silent --output vscode-server.tar.gz $SERVER_DOWNLOAD_URL
After (OK):
if [[ ! -z $(which curl) ]]; then
curl --retry 3 --connect-timeout 10 --location --show-error --silent --output vscode-server.tar.gz $SERVER_DOWNLOAD_URL
elif [[ ! -z $(which wget) ]]; then
wget --tries=3 --timeout=10 --continue --no-verbose -O vscode-server.tar.gz $SERVER_DOWNLOAD_URL