Testing ICAP Plug-in
  • PDF

Testing ICAP Plug-in

  • PDF

Testing ICAP Plug-in with C-ICAP and Squid Proxy Server

In order to test the functionality of the ICAP Plug-in, an ICAP client and a proxy server are required. 

The most popular ICAP client is C-ICAP and it can be used to test your ICAP server configuration. C-ICAP is an implementation of an ICAP server, and it can be used with HTTP proxies that support the ICAP protocol to implement content adaptation and filtering services.

Squid is a caching and forwarding HTTP web proxy. It has a wide variety of uses, including speeding up a web server by caching repeated requests, caching web, DNS and other computer network lookups for a group of people sharing network resources, and aiding security by filtering traffic.

Minimum Requirements

  • C-ICAP Client
  • Proxy Server (eg. Squid)

Install C-ICAP

You can install C-ICAP using the following commands:

  • apt-get update -y
  • apt-get install -y c-icap

Testing

Template command to test response mode:

c-icap-client -i <IP address of the machine which has the running Go ICAP server> -p <port number> -s <service name> -f <file name which wanted to be processed> -o <name which you want the file name to be after processing> -v

Example command to test response mode:

c-icap-client -i 127.0.0.1 -p 1344 -s gw_rebuild -f sample.pdf -o out.pdf -v

Template command to test request mode:

c-icap-client -i <IP address of the machine which has the running Go ICAP server> -p <port number> -s <service name> -f <file name which wanted to be processed> -o <name which you want the file name to be after processing> -v -req <website link>

Example command to test request mode:

c-icap-client -i 127.0.0.1 -p 1344 -s gw_rebuild -f sample.pdf -o out.pdf -v -req http://www.example.com

Testing with Squid

  1. Capture packets on the server while downloading a PDF from your client browser:
    Shell
    sudo tcpdump -i lo -s 65535 -w icap.pcap port 1344
    ctrl + c when download completed

  2. Open .pcap file with Wireshark and apply content type filter:
    Shell
    http.content_type == "application/pdf"
    You should see the following:


Was this article helpful?