Socks5 for PKG

Hi guys, need to download packages behind a proxy through socks5. Reading the manual doesn't seem pkg provides this feature.

Can I use any other alternative method, can you recommend one?

Thanks... 🙏
 
FETCH supports socks5, does PKG piggyback on it?
I believe it does (or at least the libfetch intermediate). Or at least that seems to be what is implied by the issue tracker.

Looking at fetch(3), it seems that it respects the SOCKS5_PROXY environment variable. Perhaps try setting that before running pkg?

The question is if it supports SOCKS5h, as in it also uses socks to resolve DNS.
 
kpedersen

It worked:

Code:
SOCKS5_PROXY=localhost:12000 fetch https://download.freebsd.org/releases/amd64/amd64/ISO-IMAGES/14.2/FreeBSD-14.2-RELEASE-amd64-bootonly.iso
FreeBSD-14.2-RELEASE-amd64-bootonly.iso         3% of  438 MB 1617 kBps 04m15s^C
fetch: transfer interrupted
 
The pkg.conf documentation (PKG.CONF(5)) says:

Code:
PKG_ENV:    Key/Value list
            This tells pkg(8) to set key/values    to be  passed  in  the
            environment.   This     allow    setting    variables to configure
            the    http(s)    fetcher.  Which    accepts    environment  variables
            compatible    with fetch(3), e.g., HTTP_PROXY.  Default: not
            set.

While the fetch documentation says (FETCH(3)) says:

Code:
SOCKS5_PROXY   Uses    SOCKS version 5    to make    connection.  The  for-
               mat    must be    the IP or hostname followed by a colon
               for the port.  IPv6 addresses must enclose the  ad-
               dress  in  brackets.      If no    port is    specified, the
               default is 1080.  This  setting  will  supercede  a
               connection to an HTTP_PROXY.

If the former inherits from the latter and the latter supports socks5, thus the former as well supports it. Am I wrong? 🤷‍♂️

How do I pass this environment variable to pkg.conf ?

This didn't worked out:

Code:
PKG_ENV {
SOCKS5_PROXY=localhost:12000
}

Thanks... 🙏
 
atax1a

Thank you, it doesn't work...
I tried with this other semantic (and variations):

Code:
pkg_env: {
     socks5_proxy: "localhost:12000",
}

But it didn't work either...

I tried hard but I must give up... 😖
 
Back
Top