string url = "http://localhost:53453";
using (WebApp.Start(url))
{
Console.WriteLine("SignalR Server running on {0}", url);
Console.Read();
}
Startup.cs
public void Configuration(IAppBuilder app)
{
app.UseCors(CorsOptions.AllowAll);
app.MapSignalR();
}
Server.cs(HUB)
[HubName("Server")]
public class Server:Hub
{
public void baglan(string uid)
{
string userid = uid;
}
}
When I run the website I get these errors.Please help me to fix it.
GET http://localhost:53453/signalr/hubs net::ERR_CONNECTION_REFUSED
jquery.signalR-2.2.3.js:247 Uncaught Error: SignalR: Error loading hubs. Ensure your hubs reference is correct, e.g. <script src='/signalr/js'></script>.
at Object.start (jquery.signalR-2.2.3.js:247)
at HTMLDocument.<anonymous> (Panel:29)
at fire (jquery-1.10.2.js:3062)
at Object.fireWith [as resolveWith] (jquery-1.10.2.js:3174)
at Function.ready (jquery-1.10.2.js:447)
at HTMLDocument.completed (jquery-1.10.2.js:118)
Is your hub really named "Server"? var chat
= $.connection.Server;
Even if so, note that unless you decorated it with the HubName attribute, specifying the name as "Server", the first letter will be made lowercase "server" in the JS proxy. And that's how you would reference it there.
It will behave the same way with any server methods you might be trying to call as well.
None
0 Points
4 Posts
SignalR Connection Refused
Mar 29, 2018 12:23 PM|CSHARPER___|LINK
Hello Everybody
I'm using signalr for first time,
I have a c# console application (server) and an mvc application (client)
My Client Side Connection Code;
My server side code block
Startup.cs
Server.cs(HUB)
When I run the website I get these errors.Please help me to fix it.
GET http://localhost:53453/signalr/hubs net::ERR_CONNECTION_REFUSED
jquery.signalR-2.2.3.js:247 Uncaught Error: SignalR: Error loading hubs. Ensure your hubs reference is correct, e.g. <script src='/signalr/js'></script>.
at Object.start (jquery.signalR-2.2.3.js:247)
at HTMLDocument.<anonymous> (Panel:29)
at fire (jquery-1.10.2.js:3062)
at Object.fireWith [as resolveWith] (jquery-1.10.2.js:3174)
at Function.ready (jquery-1.10.2.js:447)
at HTMLDocument.completed (jquery-1.10.2.js:118)
None
0 Points
10 Posts
Re: SignalR Connection Refused
Mar 29, 2018 07:32 PM|Underground|LINK
Is your hub really named "Server"? var chat = $.connection.Server;
Even if so, note that unless you decorated it with the HubName attribute, specifying the name as "Server", the first letter will be made lowercase "server" in the JS proxy. And that's how you would reference it there.
It will behave the same way with any server methods you might be trying to call as well.
None
0 Points
4 Posts
Re: SignalR Connection Refused
Mar 31, 2018 03:50 PM|CSHARPER___|LINK
Thanks for your help.
I've fixed my error with changing this
to