How does ES handle proxy servers?


Author
Message
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (2.7K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
What happens, if the user of an application that is using ES, has a proxy server between them and the ES server? How is this handled?



I have a user who can't connect and thought (give his situation) this would be the first thing to look into.
StrataFrame Team
S
StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
We use the HttpWebRequest object which has a Proxy property.  You can set the Proxy property on the EnterpriseDataSourceItem when you create it and that reference will be used to set the Proxy on the web request.  So, you might try setting:

EnterpriseDataSourceItem esds = New EnterpriseDataSourceItem(...)
esds.Proxy = System.Net.WebProxy.GetDefaultProxy()

That will retrieve the non-dynamic proxy from the Internet Options if the computer has IE 5.5 or later.  If that doesn't get the proxy, then you'll need to create a new WebProxy object with all of the settings and pass it to the EnterpriseDataSourceItem.

Hope that helps.

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (2.7K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Well, if the problem is proxy related, this will help BigGrin



Is there any adverse affect of just always setting the proxy to the default proxy, especially for users who aren't using a proxy?
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (2.7K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
bump...
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (2.7K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I'm getting a bunch of pressure to fix this issue. Does using the default proxy for all connections cause any problems? Sorry if this is a dumb question, but I know very little about how proxies/tcp connnections work.
StrataFrame Team
S
StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Yes, the default proxy will work for most connections.  The only time it won't work is when the user's Internet Options are set to automatically configure the proxy, which, as far as I know, is not very often.  So, just going with the default proxy should be good enough for you. 

If you end up with a user that cannot use the default proxy, then implementing a custom proxy is actually quite simple... you just have to have the address, port number, username, and password.  You can create a new System.Net.WebProxy with those values (putting the username and password into a new System.Net.NetworkCredential object) and you'll be off to the races.  But I would certaily stick with the default one until you run into a user that needs a non-default proxy, then implement it... because it would be really hard to test it without a test bed.

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (2.7K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Thanks Ben!
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (2.7K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I added the line to use GetDefaultProxy() and I get a warning that indicates this method is obsolete. After some searching, it seems that maybe .NET 2.0 gets the default proxy as the default. Here's an article about it:



http://msdn.microsoft.com/msdnmag/issues/05/08/AutomaticProxyDetection/default.aspx



I'm guessing that this means that ES would already be using the default proxy? Or do I need to still set the proxy?
StrataFrame Team
S
StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
According to the WebRequest.DefaultWebProxy documentation, it looks like the DefaultWebProxy is used if the Proxy is not explicitly set on the WebRequest object (which is similar to what we do with the Proxy property of the EnterpriseDataSourceItem, if it's not null, we set it on the WebRequest objects used by the data source).  So, check the value of the DefaultWebProxy property.  If it's null and the GetDefaultWebProxy() method is deprecated, then try the WebRequest.GetSystemWebProxy() which should do the same thing (and looks like the replacement for the WebProxy.GetDefaultProxy() method).  If that also doesn't work, then it looks like you'll have store off the proxy settings and create a new instance of the WebProxy object with those settings.
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (2.7K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Ben,



I'm still having problems with this...so a few more questions. I'm still a noobie concerning this proxy stuff Blush



- Is there any issues if the proxy is setup to use windows authentication?

- If the internet options are configured to use automatic proxy, do I need to do anything differently?

- Do you have any recommendations for testing this? I.e. any suggested proxy servers that could be setup to test this functionality?



Thanks!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search