To have your application send a Connection: Keep-Alive
header, use the KeepAlive property on the HttpWebRequest
object.
When a client knows that it is behind a proxy (like Fiddler), it may send a Proxy-Connection: Keep-Alive
header instead of a Connection: Keep-Alive
header. The expectation is that a HTTP/1.1 proxy (like Fiddler) will convert that header from Proxy-Connection
to Connection
before passing it to the upstream server.
This "proxy renames header" pattern was introduced many years ago to attempt to workaround hangs in HTTP/1.0 servers that didn't support Keep-Alive
properly; the idea is that the server would ignore the Proxy-Connection
header if the outdated proxy didn't rename the header by removing the Proxy-
prefix.