using pkg behind proxy

How can I set this up so that I can do sudo pkg install packagename as a normal user.

In RHEL I would put an entry in the /etc/yum.conf for the proxy.
 
What kind of proxy are we talking about? A lot of proxies will easily work when the systems default route has been pointed to said proxy.
 
pkg(8) uses fetch(3):
Code:
     HTTP_PROXY          URL of the proxy to use for HTTP requests.  The docu-
                         ment part is ignored.  Only HTTP proxies are sup-
                         ported for HTTP requests.  If no port number is spec-
                         ified, the default is 3128.

                         Note that this proxy will also be used for FTP docu-
                         ments, unless the FTP_PROXY variable is set.

     http_proxy          Same as HTTP_PROXY, for compatibility.

Also read pkg.conf(5):
Code:
           pkg_env: {
               http_proxy: "http://myproxy:3128",
           }
 
A lot of proxies will easily work when the systems default route has been pointed to said proxy.
So-called "transparent" proxies, yes. But most proxies I've come across aren't transparent.
 
Back
Top