User208271104 posted
Thank you Even for your reply a while ago. I was working on another project right after my previous post and your reply. Now, as I am back working on this Signalr project I still have the same issue. I have attached my server/client test projects in
this post so you can build/run to best explain the problems I am facing on.
The requirements are: (1) runing the Signalr Server project as a non-admin user, and (2) the Signalr cliens can cross-domain communicate with the Server.
The current problem is: the Server can only run as non-admin user when the connecting url defined as "localhost", not "machine name" or "ip address".
I have been stuck by this problem for quite a while and really hope you could provide me a solution. I appreciate your efforts/help and thank you in advance!
namespace ServerApp
{
class Program
{
static void Main(string[] args)
{
//const string url = "http://localhost:8088"; // run as non-admin users but failed cross-domain user
var url = $"http://{Environment.MachineName}:8088"; // not run as non-admin users but communicates with other machines
WebApp.Start(url);
Console.WriteLine("Server running on {0}", url);
while (true)
{
var ki = Console.ReadKey(true);
if (ki.Key == ConsoleKey.X)
{
break;
}
}
Console.ReadKey();
}
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.UseCors(CorsOptions.AllowAll);
var hubConfiguration = new HubConfiguration()
{
EnableDetailedErrors = true,
EnableJSONP = true,
EnableJavaScriptProxies = true
};
app.MapSignalR(hubConfiguration);
}
}
[HubName("MyHub")]
public class MyHub : Hub
{
public void Send(string name, string message)
{
Clients.All.addMessage(name, message);
}
}
}
}