APT-TRANSPORT-HTTP(1)

๐Ÿ’… APT-TRANSPORT-HTTP ๐Ÿ’…

okay so bestie, welcome to the manual page for apt-transport-http โ€” it's part of APT's docs, and it's literally all about downloading stuff over the Hypertext Transfer Protocol (HTTP). buckle up ๐ŸŽ€


โœจ NAME โœจ

apt-transport-http โ€” the APT transport for downloading via the Hypertext Transfer Protocol (HTTP). yes that's the whole name, she's straightforward and I respect it ๐Ÿ’…


๐ŸŒธ DESCRIPTION ๐ŸŒธ

So this APT transport lets you use repositories that you access via the Hypertext Transfer Protocol (HTTP). It comes available by default, and it's probably the most used of all the transports โ€” main character energy fr fr ๐Ÿ‘‘.

Quick vibe check though: a transport is never called directly by a user. Nope. It gets used by APT tools based on your config. So don't try to summon her by hand, she shows up when she's needed โœจ.

Now, the tea โ˜•: HTTP is an unencrypted transport protocol, which means the whole communication with the remote server (or proxy) can be observed by a sufficiently capable attacker โ€” commonly referred to as a "man in the middle" (MITM) ๐Ÿ˜ญ. BUT โ€” and this is the important part โ€” such an attacker cannot modify the communication to compromise the security of your system, because APT's data security model is independent of the chosen transport method. Iconic. The full explanation lives in apt-secure(8), and if you want an overview of all the available transport methods, that's in sources.list(5) ๐Ÿฆ‹.


๐Ÿ’– OPTIONS ๐Ÿ’–

You can set various options in an apt.conf(5) file to modify her behavior โ€” everything from proxy configuration to workarounds for specific server limitations. let's get into it ๐Ÿซถ

๐ŸŽ€ Proxy Configuration ๐ŸŽ€

The environment variable http_proxy is supported for system wide configuration. Proxies that are specific to APT can be configured via the option Acquire::http::Proxy. And if you want a proxy used only for certain hosts, that's Acquire::http::Proxy::host ๐Ÿ’….

Even more fine-grained control? That's proxy autodetection, detailed further below ๐Ÿ‘‡. All these options use the URI format:

scheme://[[user][:pass]@]host[:port]/

Supported URI schemes are:

  • socks5h โ€” SOCKS5 with remote DNS resolution
  • http
  • https

Authentication details can be supplied via apt_auth.conf(5) instead of shoving them into the URI directly ๐Ÿ”ฅ.

The various APT configuration options support the special value DIRECT, which literally means no proxy should be used. The environment variable no_proxy is also supported for the same purpose ๐Ÿงš.

Furthermore, there are three settings provided for cache control with HTTP/1.1 compliant proxy caches:

  • Acquire::http::No-Cache โ€” tells the proxy not to use its cached response under any circumstances.
  • Acquire::http::Max-Age โ€” sets the allowed maximum age (in seconds) of an index file in the cache of the proxy.
  • Acquire::http::No-Store โ€” specifies that the proxy should not store the requested archive files in its cache. super useful for preventing the proxy from polluting its cache with (big) .deb files ๐Ÿ™ˆ

๐Ÿฆ‹ Automatic Proxy Configuration ๐Ÿฆ‹

Acquire::http::Proxy-Auto-Detect can be used to specify an external command to discover the HTTP proxy to use. The first and only parameter is a URI denoting the host to be contacted โ€” that's so you can do host-specific configuration ๐Ÿ’–.

APT expects the command to output the proxy on stdout as a single line in the previously specified URI format, or the word DIRECT if no proxy should be used. And if there's no output at all? That indicates the generic proxy settings should be used โœจ.

Heads up bestie: auto-detection will not be used for a host if a host-specific proxy configuration is already set via Acquire::http::Proxy::host. she respects the more specific setting, periodt.

See the squid-deb-proxy-client(1) and auto-apt-proxy(1) packages for example implementations ๐Ÿ‘€.

This option takes precedence over the legacy option name Acquire::http::ProxyAutoDetect โ€” the old name is still around but she's not the one in charge anymore ๐Ÿ’….

๐ŸŒˆ Connection Configuration ๐ŸŒˆ

  • Acquire::http::Timeout โ€” sets the timeout timer used by the method. This value applies to the connection as well as the data timeout.
  • Acquire::http::Dl-Limit โ€” limits the used bandwidth. It accepts integer values in kilobytes per second. The default value is 0, which deactivates the limit and tries to use all available bandwidth ๐Ÿ”ฅ. Note that this option implicitly disables downloading from multiple servers at the same time โ€” one connection at a time, she's monogamous.
  • Acquire::http::Pipeline-Depth โ€” enables HTTP pipelining (RFC 2616 section 8.1.2.2), which can be beneficial e.g. on high-latency connections. It specifies how many requests are sent in a pipeline. APT tries to detect and work around misbehaving webservers and proxies at runtime, but if you know yours doesn't conform to the HTTP/1.1 specification, pipelining can be disabled by setting the value to 0. It is enabled by default with the value 10 โœจ.
  • Acquire::http::AllowRedirect โ€” controls whether APT will follow redirects. Enabled by default.
  • Acquire::http::User-Agent โ€” lets you set a different User-Agent for the http download method, since some proxies only allow access for clients if the client uses a known identifier ๐Ÿ‘€.
  • Acquire::http::SendAccept โ€” enabled by default, and sends an Accept: text/* header field to the server for requests without file extensions, to prevent the server from attempting content negotiation ๐ŸŽ€.

๐Ÿ’œ EXAMPLES ๐Ÿ’œ

here's what it looks like all put together, slay:

    Acquire::http {
         Proxy::example.org "DIRECT";
         Proxy "socks5h://apt:pass@127.0.0.1:9050";
         Proxy-Auto-Detect "/usr/local/bin/apt-http-proxy-auto-detect";
         No-Cache "true";
         Max-Age "3600";
         No-Store "true";
         Timeout "10";
         Dl-Limit "42";
         Pipeline-Depth "0";
         AllowRedirect "false";
         User-Agent "My APT-HTTP";
         SendAccept "false";
    };

๐Ÿ‘‘ SEE ALSO ๐Ÿ‘‘

apt.conf(5) apt_auth.conf(5) sources.list(5)

go read those too, iykyk ๐Ÿซถ


๐Ÿ’€ BUGS ๐Ÿ’€

Found a bug? Go check the APT bug page[1]. If you wish to report a bug in APT, please see /usr/share/doc/debian/bug-reporting.txt or the reportbug(1) command. they'll help you out bestie, no need to suffer in silence ๐Ÿ˜ญ


๐ŸŒธ AUTHOR ๐ŸŒธ

APT team โ€” the whole squad ๐Ÿ’–


โญ NOTES โญ

  1. APT bug page https://bugs.debian.org/src:apt

and that's the page!! this gorgeous piece of documentation is from APT 3.3.5, dated 04 April 2019 โ€” yeah she's got a vintage vibe but she's still out here slaying ๐Ÿ’…โœจ bye bestie, go download something ๐ŸŽ€๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from