這是本文件的舊版!


squid

pkg install squid
pkg install htdigest
sysrc squid_enable="YES"

/usr/local/etc/squid/squid.conf

auth_param digest realm proxy
auth_param digest program /usr/local/libexec/squid/digest_file_auth -c /usr/local/etc/squid/password
acl users proxy_auth REQUIRED
acl ncku src 140.116.0.0/16
http_access deny !ncku
http_access allow users
http_port 3128

# Leave coredumps in the first cache dir
coredump_dir /var/squid/cache
apache-htdigest -c /usr/local/etc/squid/passwords realm username
# or htdigest if apache-htdigest is not found
squid -f /usr/local/etc/squid/squid.conf -k parse
service squid start