What Confuses or causes my Http Web Request header to sometimes contain "Proxy-Connection" instead of "Connection"?
I have a desktop application in C#.NET that is very frequently connecting to a ASMX web service. There are two background workers those are connecting to this web services very frequently. The application also has two web browser controls in the form that load two differ开发者_开发技巧ent web pages from a ASP.NET website. These pages also have constant AJAX requests going on.
Problem: Sometimes some of the requests - both through the web reference & XMLHttp in the browser pages get stuck. I checked using fiddler and found that these requests get a http status 502 response and had actually failed at TCP IP connection. The pattern/cause of problem that I have identified is that all the http web requests from the application normally contain the "Connection" header, but some requests at random instead contain the "Proxy-Connection" header. And it is sure that the 502 error is caused ALWAYS and ONLY for these requests with "Proxy-Connection" header.
If this is the cause of the issue, I am wondering what is it that causes some of the requests to send the "Proxy-Connection" header instead of normal "Connection" header?
UPDATE: As I constantly testing and monitoring this using fiddler - I have a new finding now. While the application is running and fiddler is capturing logs - I randomly search the logs for "Proxy" in request headers and sometimes it says "1 sessions contained 'Proxy'" but the next moment when I research again it says "0 sessions contained 'Proxy'". I have even quickly saved the selected log when it said "1 sessions contained 'Proxy'" but when I later check that saved log, it does NOT contain 'Proxy' in request headers and the status is also 200 (not 502). Now as I am playing with the fiddler capturing live logs, I see that almost all (or most) of the requests actually start with the "Proxy-Connection" header that gets changed to "Connection" by the time the request completes. So does this that the requests that do not complete retain the "Proxy-Connection" header?
Any clue? I am confused and trying to figure out atleast the fact that - whether Proxy-Connection header is causing the 502 error? OR the 502 error is causing the Proxy-Connection header?
There must be some proxy sitting between you and the web server. If you look at http://www.checkupdown.com/status/E502.html the HTTP 502 error typically arises because the proxy or gateway can't connect to the destination server. Typically this is either due to connectivity issues or load issues (if you're running through your own router then it's probably connectivity, if you're running through a transparent proxy from your ISP, then it could be either).
There's not much you can do to stop the error, you'll have to write your code to catch this error and retry.
So to answer your question:
whether Proxy-Connection header is causing the 502 error? OR the 502 error is causing the Proxy-Connection header?
The Proxy-Connection header is an indication of some proxy or gateway having an error connecting to the web service. It is not in itself the cause of the 502 error, and the 502 error is not the cause of the Proxy-Connection header.
精彩评论