By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,857 Members | 1,793 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,857 IT Pros & Developers. It's quick & easy.

inconsistent response to http post request in .net proxy

P: n/a
All,

I am writing an HTTP 1.1 compliant proxy in c#.NET, for use as a proxy
server for any web browser (IE, firefox, etc). I've got it working
fine for GET requests. However, when a POST request is issued by IE, I
find that sometimes IE does not render the page, even though my proxy
reports that it successfully sent the response from the server back to
IE. So, in IE a blank page is rendered. If I use a plugin like
IEWatch, it seems to show the correct response headers and content
coming from the proxy.

Additionally, if I step through the proxy with the debugger in Visual
Studio, the problem does not reproduce. This is perplexing because I
am only using the synchronous socket API's in system.net.sockets.
Also, if I issue the same POST request with firefox, the problem does
not reproduce. So it's an issue specific to IE as the client. Any
ideas? Does IE require HTTP connections to be handled in a specific
way? Or perhaps does it expect intermediary proxies to handle
responses in a specific way?

Thanks

Jan 24 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hi figelwump,

Can you view the source of the response page?(View>Source menu)
If so it may be you have malformed html in your response page (orphaned
tags, duplicate tag attributes). These have been causing rendering problems
in IE6 SP2 and IE7, but not in other browsers.

Regards.
<fi*******@gmail.comwrote in message
news:11**********************@v33g2000cwv.googlegr oups.com...
All,

I am writing an HTTP 1.1 compliant proxy in c#.NET, for use as a proxy
server for any web browser (IE, firefox, etc). I've got it working
fine for GET requests. However, when a POST request is issued by IE, I
find that sometimes IE does not render the page, even though my proxy
reports that it successfully sent the response from the server back to
IE. So, in IE a blank page is rendered. If I use a plugin like
IEWatch, it seems to show the correct response headers and content
coming from the proxy.

Additionally, if I step through the proxy with the debugger in Visual
Studio, the problem does not reproduce. This is perplexing because I
am only using the synchronous socket API's in system.net.sockets.
Also, if I issue the same POST request with firefox, the problem does
not reproduce. So it's an issue specific to IE as the client. Any
ideas? Does IE require HTTP connections to be handled in a specific
way? Or perhaps does it expect intermediary proxies to handle
responses in a specific way?

Thanks

Jan 25 '07 #2

P: n/a
If I view source in IE, I get the following:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html;
charset=utf-8"></HEAD>
<BODY></BODY></HTML>

.... and it's rendered as a blank page, as expected. However, the proxy
reports the contents that it sends back to the client, and that looks
like the correct HTML. So I'm not sure how/where data is getting lost
here?

On Jan 24, 5:36 pm, "Rob ^_^" <iecustomi...@hotmail.comwrote:
Hi figelwump,

Can you view the source of the response page?(View>Source menu)
If so it may be you have malformed html in your response page (orphaned
tags, duplicate tag attributes). These have been causing rendering problems
in IE6 SP2 and IE7, but not in other browsers.

Regards.<figelw...@gmail.comwrote in messagenews:11**********************@v33g2000cwv.g ooglegroups.com...
All,
I am writing an HTTP 1.1 compliant proxy in c#.NET, for use as a proxy
server for any web browser (IE, firefox, etc). I've got it working
fine for GET requests. However, when a POST request is issued by IE, I
find that sometimes IE does not render the page, even though my proxy
reports that it successfully sent the response from the server back to
IE. So, in IE a blank page is rendered. If I use a plugin like
IEWatch, it seems to show the correct response headers and content
coming from the proxy.
Additionally, if I step through the proxy with the debugger in Visual
Studio, the problem does not reproduce. This is perplexing because I
am only using the synchronous socket API's in system.net.sockets.
Also, if I issue the same POST request with firefox, the problem does
not reproduce. So it's an issue specific to IE as the client. Any
ideas? Does IE require HTTP connections to be handled in a specific
way? Or perhaps does it expect intermediary proxies to handle
responses in a specific way?
Thanks
Jan 25 '07 #3

P: n/a
<fi*******@gmail.comwrote in message
news:11**********************@v33g2000cwv.googlegr oups.com...
All,

I am writing an HTTP 1.1 compliant proxy in c#.NET, for use as a proxy
server for any web browser (IE, firefox, etc). I've got it working
fine for GET requests. However, when a POST request is issued by IE, I
find that sometimes IE does not render the page, even though my proxy
reports that it successfully sent the response from the server back to
IE. So, in IE a blank page is rendered. If I use a plugin like
IEWatch, it seems to show the correct response headers and content
coming from the proxy.
Additionally, if I step through the proxy with the debugger in Visual
Studio, the problem does not reproduce.

If it's a timing problem using a debugger or using a proxy tracer
is going to change the timing. BTW have you tried using FiddlerTool
as your tracer too? Note that it has an option to allow it to be "downstream"
so I think you could chain it in just about wherever you want.

This is perplexing because I
am only using the synchronous socket API's in system.net.sockets.
Also, if I issue the same POST request with firefox, the problem does
not reproduce. So it's an issue specific to IE as the client. Any
ideas?

Yet another undocumented and uncontrollable timeout, plus inappropriate
error recovery for such an event would be my guess.

To test this idea try using a transparent tracer, such as netcap.
Format its .cap files with Ethereal and pay attention to the differences
in timestamps of the packets when it works and contrast those
with the timing when it doesn't.

Does IE require HTTP connections to be handled in a specific
way? Or perhaps does it expect intermediary proxies to handle
responses in a specific way?

Thanks

Analyse what FiddlerTool does, assuming it doesn't exhibit
the problem symtpom?

BTW try the MSDN web forums for IE instead of newsgroups
if you're hoping to catch the attention of responders from MS.
Good luck

Robert Aldwinckle
---
Jan 25 '07 #4

P: n/a
Thus wrote fi*******@gmail.com,
All,

I am writing an HTTP 1.1 compliant proxy in c#.NET, for use as a proxy
server for any web browser (IE, firefox, etc). I've got it working
fine for GET requests. However, when a POST request is issued by IE,
I find that sometimes IE does not render the page, even though my
proxy reports that it successfully sent the response from the server
back to IE. So, in IE a blank page is rendered. If I use a plugin
like IEWatch, it seems to show the correct response headers and
content coming from the proxy.

Additionally, if I step through the proxy with the debugger in Visual
Studio, the problem does not reproduce. This is perplexing because I
am only using the synchronous socket API's in system.net.sockets.
Also, if I issue the same POST request with firefox, the problem does
not reproduce. So it's an issue specific to IE as the client. Any
ideas? Does IE require HTTP connections to be handled in a specific
way? Or perhaps does it expect intermediary proxies to handle
responses in a specific way?
Is your connection handling correct according to RFC 2616 or whatever HTTP
version to want to support? Especially regarding persistent connections?

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Jan 25 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.