Hi,
My below client code (Console Application) successfully connects to the SignalR while server application runs locally.
var hubConnection = new HubConnectionBuilder()
.WithUrl("http://localhost:62114/signalr")
.Build();
hubConnection.On<string>("getMessage", message => Console.WriteLine(message));
hubConnection.StartAsync().Wait();
Console.WriteLine("Press Enter to Exit ...");
Console.ReadLine();
But if I deploy my server application at azure then my following client (Console application) with the following code, throws "System.Net.WebSockets.WebSocketException. Unable to connect to the remote server" at the line "hubConnection.StartAsync().Wait();"
var hubConnection = new HubConnectionBuilder()
.WithUrl("http://ivend365retail-signalrtest.azurewebsites.net/signalr")
.Build();
hubConnection.On<string>("getMessage", message => Console.WriteLine(message));
hubConnection.StartAsync().Wait();
Console.WriteLine("Press Enter to Exit ...");
Console.ReadLine();
Please advise how to fix this issue...
Regards, Mahendra
2 Answer(s)
-
0
I got the answer.... For the benefit of other people...if you are facing the same issue then please follow this URL....
<a class="postlink" href="https://docs.microsoft.com/en-us/aspnet/core/signalr/publish-to-azure-web-app?view=aspnetcore-2.1">https://docs.microsoft.com/en-us/aspnet ... etcore-2.1</a>
-
0
Thanks @pankajmathur :)