How to report back to Squid which peer to use?
by armandio992 from LinuxQuestions.org on (#6N9BA)
Let's say, I have a python script which handles ACL:
Code:#squid.conf
# [............]
# sub-proxies/peers
cache_peer 01.01.01.99 parent 34433 0 no-query no-digest name=peer1
cache_peer 01.01.02.99 parent 34433 0 no-query no-digest name=peer2
cache_peer 01.01.03.99 parent 34433 0 no-query no-digest name=peer3
cache_peer 01.01.04.99 parent 34433 0 no-query no-digest name=peer4
external_acl_type my_acl_helper ttl=30 %LOGIN ./my_acl_helper.py
acl session_acl external my_acl_helper
# [............]In my_acl_helper.py there's some tricky logic of selecting a peer to be used for a request.
How should my_acl_helper.py report back to Squid which peer it's choosen? In what format? As far as I've found out, it could only be OK or ERR. But the IP:port or the alias of a peer will be needed as well. How?
Code:#squid.conf
# [............]
# sub-proxies/peers
cache_peer 01.01.01.99 parent 34433 0 no-query no-digest name=peer1
cache_peer 01.01.02.99 parent 34433 0 no-query no-digest name=peer2
cache_peer 01.01.03.99 parent 34433 0 no-query no-digest name=peer3
cache_peer 01.01.04.99 parent 34433 0 no-query no-digest name=peer4
external_acl_type my_acl_helper ttl=30 %LOGIN ./my_acl_helper.py
acl session_acl external my_acl_helper
# [............]In my_acl_helper.py there's some tricky logic of selecting a peer to be used for a request.
How should my_acl_helper.py report back to Squid which peer it's choosen? In what format? As far as I've found out, it could only be OK or ERR. But the IP:port or the alias of a peer will be needed as well. How?