Last post Apr 10, 2013 04:52 AM by Bydia
Feb 08, 2013 05:31 AM|DrKoch|LINK
It took me some time to find all the information listed below, so please add these details to the documentation of SignalR SelfHost:
(SignalR Self-host documentation: https://github.com/SignalR/SignalR/wiki/Self-host)
The URL "http://localhost:8080" works for local testing only.
The URL is used to open an HttpListener.With the url above this HttpListener
will accept requests from http://localhost only, Other, equivalent URLs do not work:
In a more realistic setup you'd use an url like "http://+:8080"
(see HttpListener documentation for details)
HttpListener Class http://msdn.microsoft.com/en-us/library/system.net.httplistener.aspx
... to specify that the HttpListener accepts all requests sent to a port, replace the host element with the "+" character, "https://+:8080".
Such a URL reqires
a) that your SelfHost process has sufficient rights -or-
b) configuring namespace reservations
The latter is done with a netsh command run as Admin, for details see
"Configuring HTTP and HTTPS" http://msdn.microsoft.com/en-us/library/ms733768.aspx
Running Windows Vista, Windows Server 2008 R2 or Windows 7
netsh http add urlacl url=http://+:80/MyUri user=Everyone
netsh http add urlacl url=http://*:8080/ user=Everyone
This command adds an URL reservation for the specified URL namespace
Remark: This is also discussed here: https://github.com/SignalR/SignalR/issues/684
(The analysis is outdated, but the solutions still apply)
Apr 10, 2013 04:52 AM|Bydia|LINK
Thank-you for the information... but I'm still having problems.
My self hosted service works under my account and to localhost. When I add the following:
netsh http add urlacl url=http://+:5003/ user=Everyone
Then my server errors with:
Exception has been thrown by the target of an invocation.
Not sure where to go from here.