Squid: * 連接到 IP 位址連接埠 3128 失敗: 連線被拒絕

Squid: * 連接到 IP 位址連接埠 3128 失敗: 連線被拒絕

我正在用魷魚設定代理伺服器。

完成所有步驟後,我重新啟動並
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
捲曲:(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

我跟著本指南。一切都很順利,直到第三步開始,我用來curl測試魷魚連接。

裡面有什麼squid.conf需要修改的地方嗎?你如何解決這個問題?

答案1

ipaddress應該是127.0.0.1或,而不是 ip2location.com 或類似網站上顯示的 IP 位址localhost。該命令應該是或curl -v -x http://your_squid_username:[email protected]:3128curl -v -x http://your_squid_username:your_squid_password@localhost:3128

相關內容