V
Vincent van Scherpenseel
Hello group,
I'm writing a simple script which should connect to a HTTP proxy server,
then send a GET request and display the output of the GET request. After
that it should continue with other tasks.
It's all going well, until I use HTTP/1.1. Most HTTP/1.1 requests are
Keep-Alive connections and thus perl keeps the connection (IO::Socket)
alive.
Here's a (much) simplified version of my code:
Now my problem is that because of the Keep-Alive connection, my script
'hangs' within the while-loop, and thus doesn't continue its operations. Is
there a way to support Keep-Alive connections but still let my script
continue like it should?
Please help me how to work around this.
Yours Sincerely
Vincent van Scherpenseel
I'm writing a simple script which should connect to a HTTP proxy server,
then send a GET request and display the output of the GET request. After
that it should continue with other tasks.
It's all going well, until I use HTTP/1.1. Most HTTP/1.1 requests are
Keep-Alive connections and thus perl keeps the connection (IO::Socket)
alive.
Here's a (much) simplified version of my code:
while (<$remote>) {
print $client $_;
}
close $remote;
Now my problem is that because of the Keep-Alive connection, my script
'hangs' within the while-loop, and thus doesn't continue its operations. Is
there a way to support Keep-Alive connections but still let my script
continue like it should?
Please help me how to work around this.
Yours Sincerely
Vincent van Scherpenseel