2
votes

We are updating our existing Windows desktop software with signalR instead of original WCF. At the beginning of learning SignalR we have problem with server which starts well with the uri http://localhost:8080 but if I use the http://*:8080 or http://MyIPServer:8080 it doesn't work until I run the program under admin.

When running normally without admin rights, I have an error in the webApp.start (an exception occurs, nothing more!).

I've added a filter rule in the Windows firewall to accept all 8080 port inbound, but without much more success

The code is simple (it is from the Microsoft sample):

   const string ServerURI = "http://localhost:8080";
   private void StartServer()
        {
            try
            {
                SignalR = WebApp.Start(ServerURI);
            }
            catch (TargetInvocationException ex)
            {
                WriteToConsole("A server error: " + ex.Message );
                this.Dispatcher.Invoke(() => ButtonStart.IsEnabled = true);
                return;
            }
            this.Dispatcher.Invoke(() => ButtonStop.IsEnabled = true);
            WriteToConsole("Server started at " + ServerURI);
        }

Any ideas ?

Thank you for your help.

1

1 Answers

3
votes

Take a look at URL ACL. You can provide the rights to start a server like this on the command line:

netsh http add urlacl http://+:8080/ user=Everyone

You can use Everyone (must be localized!) or a specific user.