如何设置带有身份验证的本地代理进行测试



我想用用户和密码设置一个本地代理来测试

以下是如何使用squid:

sudo apt-get update
sudo apt-get install squid3

admin:$apr1$kWA/DRFy$klaeXRe3S3jIPqc64HTMA0粘贴到/etc/squid/passwords文件中

sudo chmod 777 /etc/squid/passwords

备份默认squid配置文件:

sudo mv /etc/squid/squid.conf /etc/squid/squid.conf.original

将以下内容粘贴到/etc/squid/squid.conf

auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwords
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 24 hours
auth_param basic casesensitive off
acl authenticated proxy_auth REQUIRED
http_access allow authenticated
http_access deny all
dns_v4_first on
forwarded_for delete
via off
http_port 8888

重新启动squid

sudo service squid restart

代理详细信息:

  • ip:localhost
  • 端口:8888
  • 用户:admin
  • 密码:1234

测试使用:

curl -x http://admin:1234@localhost:8888 http://icanhazip.com

参考文献:1.2

相关内容

  • 没有找到相关文章