gpt4 book ai didi

http - 鱿鱼代理 - 如何允许 tcp 连接 - 使用 ERR_INVALID_ARGUMENT 获取 TCP_DENIED/400

转载 作者:可可西里 更新时间:2023-11-01 02:30:34 25 4
gpt4 key购买 nike

我有一台设备需要连接到 tcp:80 上的互联网服务,但该网络没有直接的互联网访问权限。所以我使用 squid 代理来解决这个问题。

设备允许我输入代理服务器、端口、用户名和密码。

我发现该设备使用 http CONNECT 而不是 http GET(在我的浏览器上运行良好)。

当设备尝试连接时,它收到 HTTP 错误 400。鱿鱼 access.log 只给我这个:

1338885433.033      0 172.22.140.129 TCP_DENIED/400 1728 CONNECT :0 - NONE/- text/html

所以我捕获了数据包以真正了解发生了什么:

来自设备的请求:

CONNECT mydomain.com:0 HTTP/1.0User-agent: Sequencer/5.5.0.5539

鱿鱼的回答:

HTTP/1.0 400 Bad Requestsquid/2.7.STABLE9X-Squid-Error: ERR_INVALID_URL 0close

我的 squid.conf:

auth_param basic program /usr/lib/squid/pam_authauth_param basic children 5auth_param basic realm Squid proxy-caching web serverauth_param basic credentialsttl 2 hoursauth_param basic casesensitive offacl all src allacl manager proto cache_objectacl localhost src 127.0.0.1/32acl to_localhost dst 127.0.0.0/8 0.0.0.0/32acl localnet src 10.0.0.0/8     # RFC1918 possible internal networkacl localnet src 172.16.0.0/12  # RFC1918 possible internal networkacl localnet src 192.168.0.0/16 # RFC1918 possible internal networkacl SSL_ports port 443          # httpsacl SSL_ports port 563          # snewsacl SSL_ports port 873          # rsyncacl Safe_ports port 80          # httpacl Safe_ports port 21          # ftpacl Safe_ports port 443         # httpsacl Safe_ports port 70          # gopheracl Safe_ports port 210         # waisacl Safe_ports port 1025-65535  # unregistered portsacl Safe_ports port 280         # http-mgmtacl Safe_ports port 488         # gss-httpacl Safe_ports port 591         # filemakeracl Safe_ports port 777         # multiling httpacl Safe_ports port 631         # cupsacl Safe_ports port 873         # rsyncacl Safe_ports port 901         # SWATacl purge method PURGEacl CONNECT method CONNECTacl checkpw proxy_auth REQUIREDhttp_access allow manager localhosthttp_access deny managerhttp_access allow purge localhosthttp_access deny purgehttp_access deny !Safe_portshttp_access allow CONNECThttp_access allow localnethttp_access allow localhosthttp_access allow checkpw allhttp_access deny allicp_access allow localneticp_access deny allhttp_port 3128hierarchy_stoplist cgi-bin ?access_log /var/log/squid/access.log squiddebug_options ALL,1 33,2 28,9refresh_pattern ^ftp:           1440    20%     10080refresh_pattern ^gopher:        1440    0%      1440refresh_pattern -i (/cgi-bin/|\?) 0     0%      0refresh_pattern (Release|Packages(.gz)*)$       0       20%     2880refresh_pattern .               0       20%     4320acl shoutcast rep_header X-HTTP09-First-Line ^ICY.[0-9]upgrade_http0.9 deny shoutcastacl apache rep_header Server ^Apachebroken_vary_encoding allow apacheextension_methods REPORT MERGE MKACTIVITY CHECKOUThosts_file /etc/hostsforwarded_for offcoredump_dir /var/spool/squid

是否有任何解决方案可以摆脱 ERR_INVALID_URL?是我误解了 squid 代理的概念还是来自设备的请求无效?

如果需要任何其他信息,请告诉我。

先谢谢你,基督徒。

最佳答案

我通过注释掉默认的 squid.conf 解决了同样的错误:

# Deny CONNECT to other than secure SSL ports
#http_access deny CONNECT !SSL_ports

默认情况下,squid 被设置为不允许连接到非 SSL 端口。如果您想在没有 SSL 的情况下进行测试,您可以通过注释掉上面的行来禁用它。

关于http - 鱿鱼代理 - 如何允许 tcp 连接 - 使用 ERR_INVALID_ARGUMENT 获取 TCP_DENIED/400,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10895711/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com