Is there a way (supported or a hack) to find out what *filtered* data is
waiting to be posted to a POE::Wheel::ReadWrite InputEvent?  

At my workplace, we have an HTTP proxy that requires NTLM authentication.
This works great for Internet Explorer users, but Netscape and Mac users
(and just about everyone else) are left in the cold.  I have started a
project to make a proxy server that works like such:

1. Client makes HTTP request to my proxy server and sends basic credentials
2. Proxy forwards request to upstream proxy and replaces basic credentials
with NTLM handshake
3. Upstream proxy sends back NTLM challenge
4. Proxy sends back NTLM response
5. Upstream proxy sends back either an HTTP code 407 (Proxy Authorization
Required) or the requested page.

In order for the NTLM authentication to work, the connection to the upstream
proxy must be kept alive during steps 2-5.  This means that elegant
solutions like PoCo::Client::HTTP are out of the question since they
explicitly terminate the connection after each request.

I have had moderate success in setting this up using POE and a mix of both
POE::Filter::Line and POE::Filter::Block.  I know switching filters
mid-stream can be tricky and have already attempted to compensate for this
by using $heap->{'readwrite'}->get_input_filter->get_pending just prior to
switching filters.  However, get_pending doesn't tell me anything about the
lines queued for posting to my InputEvent.  If I switch filters after
receiving a blank HTTP header line and some of the HTML content was also
slurped into Filter::Line, I end up receiving my get_pending data before the
other content.

Any help would be greatly appreciated.

Thanks,

Peter Guzis
Web Administrator, Sr.
ENCAD, Inc.
- A Kodak Company
email: [EMAIL PROTECTED]
www.encad.com 

Reply via email to