Update system using VPN

I’m using a VPN on my mobile phone using HttpCustom, then I share the internet with my laptop using PDANet with a wifi hotspot and exporting the proxy in my terminal:

export http_proxy=http://192.168.49.1:8000/
export https_proxy=http://192.168.49.1:8000/

wget --spider https://codingflyboy.mm.fcix.net

Spider mode enabled. Check if remote file exists.
--2023-09-22 16:10:27--  https://codingflyboy.mm.fcix.net/
Loaded CA certificate '/etc/ssl/certs/ca-certificates.crt'
Connecting to 192.168.49.1:8000... connected.
Proxy request sent, awaiting response... 200 OK
Length: 4554 (4.4K) [text/html]
Remote file exists and could contain further links,
but recursion is disabled -- not retrieving.

However, when I try to update:
sudo pacman -Syu

:: Synchronizing package databases...
 core.db failed to download
error: failed retrieving file 'core.db' from codingflyboy.mm.fcix.net : Could not resolve host: codingflyboy.mm.fcix.net
warning: too many errors from codingflyboy.mm.fcix.net, skipping for the remainder of this transaction
error: failed to synchronize all databases (invalid url for server)

Hello @jjbenitez :wink:

Don’t know how HttpCustom or PDANet works, but if you just want to proxy everything to a specifc IP:Port then use a PAC file in NetworkManager.

Example:

function FindProxyForURL(url, host) {
    // Direct connection for local addresses
    if (isPlainHostName(host) ||
        shExpMatch(host, "*.local") ||
        isInNet(dnsResolve(host), "192.168.0.0", "255.255.0.0") ||
        isInNet(dnsResolve(host), "10.0.0.0", "255.0.0.0") ||
        isInNet(dnsResolve(host), "172.16.0.0", "255.240.0.0") ||
        isInNet(dnsResolve(host), "127.0.0.0", "255.255.255.0")) {
        return "DIRECT";
    }

    // Proxy all other traffic through 192.168.49.1:8000
    return "PROXY 192.168.49.1:8000";
}

OR everything without exceptions:

function FindProxyForURL(url, host) {
  // Redirect all traffic through the proxy server at 192.168.49.1:8000
  return "PROXY 192.168.49.1:8000";
}

Save it as filename.pac somewhere in your home folder and set it in the NetworkManager (nm-connection-editor) at the proxy section. Restart the NetworkManager.