apt-cacher

automatic proxy detection

auto-apt-proxy

https://salsa.debian.org/debian/auto-apt-proxy

It try to find apt proxy on localhost, gateway or askind DNS for SRV record.

squid-deb-proxy-client

https://packages.debian.org/jessie/squid-deb-proxy-client

Main code: https://github.com/wrouesnel/squid-deb-proxy-desktop/blob/master/apt-avahi-discover

It is using avahi discover ONLY. It simply calls: <code bash>avahi-browse -kprtv _apt_proxy._tcp<code> and use the results. Not working in routed and firewalled environment.

fallback to DIRECT