Ok... A few things.
The http header: "Connection: KeepAlive;" Almost certainly will do nothing, as this normally applies to allowing multiple requests to the web proxy, and does not have anything to do with the duration of a single connection. In case you still wish to try this, send the following to the proxy: "CONNECT <host>:<port> HTTP/1.0\r\nConnection: KeepAlive;\r\n\r\n" You'll need to read the http response from the web proxy, and junk it. The response should look something like: "HTTP/1.0 200 <junk txt message>\r\n\r\n" TCP KeepAlives are also unlikely to work, unless your web proxy is really really dumb. TCP KeepAlives basically work by sending an empty TCP packet (i.e. no data), which causes a response from the remote end, only very very poor proxy software would actually forward empty packets on, because this should be transparent at the OS level, which is where the web proxy should (tm) be running, of course, this will work correctly, if your web proxy is outside of the firewall that's doing the timing out of connections, but not if it's inside. (Sidenote: because some OS's don't respond to empty tcp packets, some operating systems send a TCP packet, which contains 1 byte of data, which has already been received, causing a response). The best idea so far, seems to be to print control codes with no side effects from a background process. Or even control codes which will be ignored, as they're invalid. (I loved the clock in the title bar one) -Antony