SignalR: Error during negotiation request: undefined

前端 未结 1 1067
不知归路
不知归路 2020-12-21 08:58

I\'ve been trying to get a javascript signal-r client working against a self-hosted owin server. And am running into this issue. I\'ve tried both proxies and no proxy meth

相关标签:
1条回答
  • 2020-12-21 09:48

    If you are using SignalR 1.0.0 (which you should since it is now officially released), you need to change your call to MapHubs to enable cross-domain requests. This is assuming your website is not being served from localhost:9000. I'm guessing it isn't since you are passing in the url to $.hubConnection.

    app.MapHubs(new HubConfiguration { EnableCrossDomain = true });
    

    Before the final release of 1.0.0, CORS was enabled by default.

    0 讨论(0)
提交回复
热议问题