title: How to use Java ICAP codec with Squid
body: <p>I am trying use <a href="http://icap.mimo.ch/" rel="nofollow">Java ICAP Codec</a> 1.0.0.GA Squid Echo example with Squid and got the following exception</p>
  
  <pre><code>ch.mimo.netty.handler.codec.icap.IcapDecodingError: Mandatory ICAP message header [Encapsulated] is missing
      at ch.mimo.netty.handler.codec.icap.ReadIcapHeaderState.validateMandatoryMessageHeaders(ReadIcapHeaderState.java:104)
      at ch.mimo.netty.handler.codec.icap.ReadIcapHeaderState.execute(ReadIcapHeaderState.java:54)
      at ch.mimo.netty.handler.codec.icap.IcapMessageDecoder.decode(IcapMessageDecoder.java:97)
      at ch.mimo.netty.handler.codec.icap.IcapMessageDecoder.decode(IcapMessageDecoder.java:37)
      at org.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(ReplayingDecoder.java:470)
      at org.jboss.netty.handler.codec.replay.ReplayingDecoder.messageReceived(ReplayingDecoder.java:443)
      at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:274)
  </code></pre>
  
  <p>Here is my Squid config (related to ICAP):</p>
  
  <pre><code>icap_enable on
  icap_service service_req reqmod_precache icap://127.0.0.1:1344
  adaptation_access service_req allow all
  </code></pre>
  
  <p>What is the problem ?</p>