Squid:* 连接到 ipaddress 端口 3128 失败:连接被拒绝

Squid:* 连接到 ipaddress 端口 3128 失败:连接被拒绝

我正在用 squid 设置代理服务器。

完成所有步骤后,我重新启动并
sudo systemctl restart squid.service
返回: active
然后我尝试测试连接:

curl -v -x http://your_squid_username:your_squid_password@ipaddress:3128 http://www.google.com/

此错误的结果是:

尝试 ipaddress:3128...
连接到 ipaddress 端口 3128 失败:连接被拒绝
1 毫秒后无法连接到 ipaddress 端口 3128:连接被拒绝
关闭连接 0
curl:(7)1 毫秒后无法连接到 ipaddress 端口 3128:连接被拒绝

配置文件/etc/squid/squid.conf具有以下设置:

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#
include /etc/squid/conf.d/*.conf
auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwords
auth_param basic realm proxy
acl authenticated proxy_auth REQUIRED
# Example rule allowing access from your local networks.
acl localnet src ipaddress
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
#http_access allow localnet
http_access allow localhost
http_access allow authenticated

# And finally deny all other access to this proxy
http_access deny all

我跟着本指南一切都很顺利,直到第 3 步开始时我用来curl测试 squid 连接。

有什么squid.conf需要更改的吗?您如何解决这个问题?

答案1

而不是 ip2location.com 或类似网站上显示的 IP 地址,而ipaddress应该是127.0.0.1localhost。然后命令应该是或curl -v -x http://your_squid_username:[email protected]:3128curl -v -x http://your_squid_username:your_squid_password@localhost:3128

相关内容