Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/30.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Proxy 客户端连接到不同的代理_Proxy_Squid - Fatal编程技术网

Proxy 客户端连接到不同的代理

Proxy 客户端连接到不同的代理,proxy,squid,Proxy,Squid,我需要在Ubuntu上使用squid将不同的客户端连接到不同的代理,它们不应该连接到其他代理。。 看看这个例子: client 1 (ip 1.1.1.1) > squidservre.com:1000 > someproxyserver:1234 client 2 (ip 2.2.2.2) > squidserver.com:1001 > someproxyserver:1235 client 3...... 客户端1不应该连接到端口1001,服务器应该拒绝他,因为客

我需要在Ubuntu上使用squid将不同的客户端连接到不同的代理,它们不应该连接到其他代理。。 看看这个例子:

client 1 (ip 1.1.1.1) > squidservre.com:1000 > someproxyserver:1234
client 2 (ip 2.2.2.2) > squidserver.com:1001 > someproxyserver:1235
client 3......
客户端1不应该连接到端口1001,服务器应该拒绝他,因为客户端2也不应该连接到端口1000,它应该被拒绝

现在我使用以下代码,但问题是每个客户端都可以连接到其他代理:

acl port_1 localport 10001
acl port_2 localport 10002
acl port_3 localport 10003 
# Squid ports
http_port 10001 
http_port 10002
http_port 10003

cache_peer Proxyserverip parent 1234 0 name=host_1 no-query default
cache_peer Proxyserverip parent 1235 0 name=host_2 no-query default
cache_peer Proxyserverip parent 1236 0 name=host_3 no-query default

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

acl mysour src 1.1.1.1 #client 1
acl mysour src 2.2.2.2 #client 2

http_access allow mysour
http_access deny all
我需要指定每个客户端连接它自己的端口,服务器将把它连接到自己的Proxyserverip

我该怎么做

# Define port ACLs
acl port_1 localport 10001
acl port_2 localport 10002
acl port_3 localport 10003

# Define client IP ACLs
acl client_1 src 127.0.0.1
acl client_2 src 127.0.0.2
acl client_3 src 127.0.0.3

# Cache peer (replace PROXY_1, PROXY_2 and PROXY_3 with your proxy IPs)
never_direct allow all
cache_peer PROXY_1 parent 1234 0 name=host_1 no-query default
cache_peer PROXY_2 parent 1235 0 name=host_2 no-query default
cache_peer PROXY_3 parent 1236 0 name=host_3 no-query default
cache_peer_access host_1 allow port_1
cache_peer_access host_2 allow port_2
cache_peer_access host_3 allow port_3

# Define which ports specific clients can access
http_access allow client_1 port_1
http_access allow client_2 port_2
http_access allow client_3 port_3
http_access deny all

# Listening ports
http_port 10001 
http_port 10002
http_port 10003

# Additional config settings here