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

User Agent String not passed during HTTP CONNECT w/ proxy

P: n/a
Sorry for the cross post from dontnet.framework but I'm hoping this may see
more activity here.

I have written an application to access a web service. The application runs
at multiple sites and must cross a proxy server.

The application runs fine through all proxy servers but one that is
configured to require a "User-Agent" header. I have added the user agent
string, however it does not seem to be passed during the HTTP CONNECT to
utilize the proxy server. It does pass the user agent on requests to the
server hosting the web service though. As and aside, IE does send the
"User-Agent" during the HTTP CONNECT. Is there any way to emulate this?

Many Google searches have turned up one link that expresses the same issue
(http://thedotnet.com/nntp/358127/showpost.aspx) it was from 2005 and didn't
have an answer.

Any help would be appreciated.

I have tried this under .NET 1.1 and 2.0

Below is the C# code excerpt and network traces showing the missing
"User-Agent"; IP/Names have been changed in the trace.

I have tried this under .NET 1.1 and 2.0

Below is the C# code excerpt and network traces showing the missing
"User-Agent"; IP/Names have been changed in the trace.

ws = new Ticketmon.mon_ws();
ws.UserAgent = @"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
..NET+CLR+1.1.4322; InfoPath.1)";

WebProxy myProxy = new WebProxy();
myProxy.Address = new Uri(proxy_setting);
myProxy.Credentials = CredentialCache.DefaultCredentials;
ws.Proxy = myProxy;

Internet Protocol, Src: 111.111.111.111 (111.111.111.111), Dst:
222.222.222.222 (222.222.222.222)
Transmission Control Protocol, Src Port: 1281 (1281), Dst Port: 8080 (8080),
Seq: 1, Ack: 1, Len: 111
Hypertext Transfer Protocol
CONNECT server.domain.com:443 HTTP/1.1\r\n
Request Method: CONNECT
Request URI: server.domain.com:443
Request Version: HTTP/1.1
Proxy-Connection: Keep-Alive\r\n
Host: server.domain.com:443\r\n
\r\n

Jun 5 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.