[squid-users] icap example server not working

steven commercials24 at yahoo.de
Wed Mar 6 22:33:20 UTC 2019


hi,


after going trough rfc3507 (icap) im not really sure how a icap server 
is supposed to work together with squid, for example the python icap 
servers that are available via github have method names like:


example_OPTIONS, example_REQMOD, example_RESPMOD

yara_OPTIONS_, yara_....



or the example on this page: https://github.com/netom/pyicap

echo_OPTIONS, echo_RESPMOD


with:

icap_service service_resp respmod_precache bypass=0 
icap://127.0.0.1:1344/respmod
adaptation_access service_resp allow all

127.0.0.1 - - [06/b'Mar'/2019 23:22:58] respmod_OPTIONS not found
127.0.0.1 - - [06/b'Mar'/2019 23:22:58] code 404, message b'Not Found'


with:

icap_service service_resp respmod_precache bypass=0 
icap://127.0.0.1:1344/echo
adaptation_access service_resp allow all

----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 46458)
Traceback (most recent call last):
   File "/usr/lib/python3.7/socketserver.py", line 650, in 
process_request_thread
     self.finish_request(request, client_address)
   File "/usr/lib/python3.7/socketserver.py", line 360, in finish_request
     self.RequestHandlerClass(request, client_address, self)
   File "/usr/lib/python3.7/socketserver.py", line 720, in __init__
     self.handle()
   File 
"/home/julius/code/python/icap/venv/lib/python3.7/site-packages/pyicap.py", 
line 443, in handle
     self.handle_one_request()
   File 
"/home/julius/code/python/icap/venv/lib/python3.7/site-packages/pyicap.py", 
line 494, in handle_one_request
     method()
   File "icaptest.py", line 22, in echo_OPTIONS
     self.send_headers(False)
   File 
"/home/julius/code/python/icap/venv/lib/python3.7/site-packages/pyicap.py", 
line 326, in send_headers
     icap_header_str += k + b': ' + v + b'\r\n'
TypeError: can only concatenate str (not "bytes") to str
----------------------------------------




squid config:

icap_enable on

icap_preview_enable off
icap_send_client_ip on
icap_send_client_username on
icap_service service_req reqmod_precache bypass=1 
icap://127.0.0.1:1344/respmod
adaptation_access service_req allow all
#icap_service service_resp respmod_precache bypass=0 
icap://127.0.0.1:1344/response
#adaptation_access service_resp allow all




why is this simple example not working?



More information about the squid-users mailing list