Connecting to SignalR Hub Server over LAN, not LocalHost

brian-3463 21 Reputation points
2022-09-27T14:15:05.123+00:00

I've successfully followed a basic SignalR server-client tutorial and, like all others I've seen, it involves a client on the same machine as the server connecting over http://localhost:[port]. How do I connect a non-local client to this server? E.g. run the server code on a desktop and connect to the hubs on my laptop? I've currently tried installing IIS, disabling firewalls on both server/client, and then using the local ip of my server via cmd -> ipconfig but that hasn't worked.

Any help would be heavily appreciated, the network aspects of coding are my weakest suit and there seem to be infinite url/port combinations I could try

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,188 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,272 questions
0 comments No comments
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 56,686 Reputation points
    2022-09-27T16:27:04.587+00:00

    a couple issues

    1) the desktop and client must be on the same network
    2) the server should firewall ports 80 and 443 open
    3) to use https the servers ssl certificate must be trusted by the client

    the sample uses https. you will need to create a self signed cert. load it into IIS for the site and trust the cert on the client. or just switch to http.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful