[SOLVED] Proxy settings GUI does not work in Shell

giovannivl

Member
Apr 12, 2023
8
2
8
Hi All,

I've already config the url proxy via Datacenter - Options - Proxy, so my CT templates downloads works:

Bash:
downloading http://download.proxmox.com/images/system/ubuntu-22.04-standard_22.04-1_amd64.tar.zst to /var/lib/vz/template/cache/ubuntu-22.04-standard_22.04-1_amd64.tar.zst
--2023-08-09 07:06:33--  http://download.proxmox.com/images/system/ubuntu-22.04-standard_22.04-1_amd64.tar.zst
Resolving <proxy_info> (<proxy_info>)... <proxy_ip>
Connecting to <proxy_info> (<proxy_info>)|<proxy_ip>|:8080... connected.
Proxy request sent, awaiting response... 200 OK
Length: 129824858 (124M) [application/octet-stream]
Saving to: '/var/lib/vz/template/cache/ubuntu-22.04-standard_22.04-1_amd64.tar.zst.tmp.1554'

But, inside shell in the same node, I can not get connection, like
Code:
curl -I http://google.com
does not work.

How need I configure http proxy to work in shell-Node, Thanks!
 
Hi,

the shell is a normal system shell, without special configurations. The proxy you set up in the Datacenter options is used automatically for operations performed by PVE services.

If you want to use it yourself in e.g. your curl command above, you need to specify it. Seeman curl for what, there is the -x (or --proxy) for that:
Code:
-x, --proxy [protocol://]host[:port]
    Use the specified proxy.

   The proxy string can be specified with a protocol:// prefix. No protocol specified or http:// 
   will be treated as HTTP proxy. Use socks4://, socks4a://, socks5:// or socks5h:// to request a 
   specific SOCKS version to be used.

   Unix domain sockets are supported for socks proxy. Set localhost for the host part. e.g. 
   socks5h://localhost/path/to/socket.sock

   HTTPS proxy support via https:// protocol prefix was added in 7.52.0 for OpenSSL, GnuTLS and NSS.

Hope this helps!
 
  • Like
Reactions: giovannivl
Hi,

the shell is a normal system shell, without special configurations. The proxy you set up in the Datacenter options is used automatically for operations performed by PVE services.

If you want to use it yourself in e.g. your curl command above, you need to specify it. Seeman curl for what, there is the -x (or --proxy) for that:
Code:
-x, --proxy [protocol://]host[:port]
    Use the specified proxy.

   The proxy string can be specified with a protocol:// prefix. No protocol specified or http://
   will be treated as HTTP proxy. Use socks4://, socks4a://, socks5:// or socks5h:// to request a
   specific SOCKS version to be used.

   Unix domain sockets are supported for socks proxy. Set localhost for the host part. e.g.
   socks5h://localhost/path/to/socket.sock

   HTTPS proxy support via https:// protocol prefix was added in 7.52.0 for OpenSSL, GnuTLS and NSS.

Hope this helps!
Thanks!!! I supposed that configuration works for everything, so I will need read more about every command that I need to use.