Looks like HTTP::Proxy and/or Plack could be leveraged for icap

If HTTP::Response/HTTP::Request can parse these ical req/res then so can Proxy and Plack... probably even Mojolicious

#!/usr/bin/perl -- use strict; use warnings; use HTTP::Response; use HTTP::Request; use Data::Dump qw/ dd pp /; my $req_raw = q{REQMOD icap://icap-server.net/server?arg=87 ICAP/1.0 Host: icap-server.net Encapsulated: req-hdr=0, null-body=170 GET / HTTP/1.1 Host: www.origin-server.com Accept: text/html, text/plain Accept-Encoding: compress Cookie: ff39fk3jur@4ii0e02i If-None-Match: "xyzzy", "r2d2xxxx" }; my $res_raw = q{ICAP/1.0 200 OK Date: Mon, 10 Jan 2000 09:55:21 GMT Server: ICAP-Server-Software/1.0 Connection: close ISTag: "W3E4R7U9-L2E4-2" Encapsulated: req-hdr=0, null-body=231 GET /modified-path HTTP/1.1 Host: www.origin-server.com Via: 1.0 icap-server.net (ICAP Example ReqMod Service 1.1) Accept: text/html, text/plain, image/gif Accept-Encoding: gzip, compress If-None-Match: "xyzzy", "r2d2xxxx" }; my $req = HTTP::Request->parse($req_raw); my $res = HTTP::Response->parse($res_raw); dd( $res, $req ); dd( "req_raw eq req->as_string " => int( $req_raw eq $req->as_string ) + ); dd( "res_raw eq res->as_string " => int( $res_raw eq $res->as_string ) + ); print "-" x 33, "\n", $req->dump; print "-" x 33, "\n", $res->dump; dd( $req_raw, $req->as_string ); dd( $res_raw, $res->as_string );

In reply to Re^2: ICAP server implementation in Perl (HTTP::Request .. HTTP::Proxy) by Anonymous Monk
in thread ICAP server implementation in Perl by josef

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.