I am using the SignalR .NET client library to create a console app/win service to connect to a signal R Hub using HTTPS on the web. Some of these clients may require a web proxy to access the internet. Where/How do I set the web proxy for the SignalR client?
How on earth is this not a real Question guys? I cant get the signalR to connect to the web server hub when the client is behind a firewall/TMG proxy server.
Use Connection.Proxy property for that - https://msdn.microsoft.com/en-us/library/microsoft.aspnet.signalr.client.connection.proxy(v=vs.111).aspx
Example:
var hubConnection = new HubConnection(url);
var webProxy = new WebProxy(new Uri(“address”));
webProxy.Credentials = new NetworkCredential(“Username”, “Password”);
hubConnection.Proxy = webProxy;
Try this:
var webProxy = new WebProxy(new Uri(proxyUrl));
var connection = new HubConnectionBuilder().WithUrl("signalR hub endpoint", h => h.Proxy = webProxy).Build();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With