gpt4 book ai didi

proxy - Squid - 监听多个端口并转发到不同的代理

转载 作者:行者123 更新时间:2023-12-02 05:54:49 29 4
gpt4 key购买 nike

我想设置一个监听多个端口的代理,每个端口将请求转发到不同的代理,例如:

LISTEN          FORWARD TO 
1.2.3.4:3128 -> 5.6.7.8:3128
1.2.3.4:3129 -> 5.6.7.9:3128
1.2.3.4:3130 -> 5.6.7.10:3128

这可以用鱿鱼实现吗?

到目前为止我已经配置了:

cache_peer 5.6.7.8 parent 3128 0000 default no-query no-digest
cache_peer 5.6.7.9 parent 3128 0000 default no-query no-digest
cache_peer 5.6.7.10 parent 3128 0000 default no-query no-digest

http_port 3128
http_port 3129
http_port 3130

我不知道如何处理重定向

最佳答案

您缺少cache_peer_access 和 acl。

尝试这个配置:

acl port_1 localport 3128
acl port_2 localport 3129
acl port_3 localport 3130 # I woudn't use this one, This is reserved for ICP

http_port 3128
http_port 3129
http_port 3130

cache_peer 5.6.7.8 parent 3128 0 name=host_1
cache_peer 5.6.7.9 parent 3128 0 name=host_2
cache_peer 5.6.7.10 parent 3128 0 name=host_3

cache_peer_access host_1 allow port_1
cache_peer_access host_2 allow port_2
cache_peer_access host_3 allow port_3

never_direct allow all # Tells your squid to never use its own internet connection to process the requests. If your parent proxy won't work it will return an Error.

GL!

关于proxy - Squid - 监听多个端口并转发到不同的代理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45966359/

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