in reply to cannot do a POST with proxy

Rather than "working well", this code happens to work when there is no buffering or true bidirectional communication between the client and the server at any stage. This is breaking down when you try a POST.

You'll need to restructure your two while loops in your fetch method, to ensure you only read from the client or server when they are ready to write. perlipc shows an example, using select(), however, IO::Select should work here.

Replies are listed 'Best First'.
Re^2: cannot do a POST with proxy
by majinbis (Initiate) on Sep 17, 2009 at 06:03 UTC
    Hi. Thanks for your response. I tried implementing IO::Select but it still did the same thing (unless I implemented it the wrong way). Tried a few tweaks and it worked on the latest IE but I'm still having the same problems with FF/Chrome and older versions of IE. it seems to be doing the following: 1. When I do a POST, it send the request with the right headers as per RFC1945 (i'm only implementing HTTP/1.0) gets the headers but stops at the blank line before the body so I think what happens is that the remote host is still waiting for the body