Question

Using version 2.0 for Asp.NET SignalR, we have created a prototype application that has a WPF client application and a web site that has SignalR configured. This prototype works correctly when run on the local developer computer and when the web site was deployed to an internal development server.

An issue that has been encountered once the web site was deployed to an external server; the following exception is encountered when the HubConnection.Start method is called:

HttpClientException
A first chance exception of type 'Microsoft.AspNet.SignalR.Client.HttpClientException' occurred in mscorlib.dll
Additional information: StatusCode: 407, ReasonPhrase: 'Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied…

The network that the developer computer is on requires the use of a proxy to reach the Internet. The web site that has the SignalR component also has some WCF endpoints; these can be connected to using the HttpClient within the WPF client application when the proxy is set in code. The same approach to set the proxy was done on the HubConnection but the error is encountered.

Below is code on how the proxy is set to the HubConnection; the same credentials work when accessing the other, non-signalR, endpoints:

var proxyInfo = new WebProxy(new Uri(“theAddress”));

proxyInfo.Credentials = new NetworkCredential(“theUserName”, “thePassword”, “theDomain”);

hubConnection.Proxy = proxyInfo;

Is there something else that has to be set with the HubConnection for it to use the proxy?

Thanks, Scott

Was it helpful?

Solution

The issue is that there is a bug with the 4.5 .NET Client for SignalR; the proxy information is not being sent with the requests in the HubConnection. This is a regression from the 1.0 release.

The link below contains the information:

https://github.com/SignalR/SignalR/issues/2856

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top