How to modify the SignalR Hub URL

你。 提交于 2019-12-04 12:36:29

Ran across this, possible now with 0.5+:

RouteTable.Routes.MapHubs("~/api");
  1. No you may not, it's hardcoded in the source.
  2. No the proxy generated is for all hubs.

Well this question is old (4 years? wtf.. I always thought web sockets was kinda new).

... Well they(Microsoft) have new descriptive well written documentation on their website now

This could be a link only answer but if you are in a hurry.... On the server side at the startup or owin app config have somthing like this...

app.MapSignalR("/newCoolUrl", new HubConfiguration());

Ehhh sure you need to replace everything "/signalr" on whichever clients you are using to "/newCoolUrl" example

var connection = $.hubConnection("/newCoolUrl", { useDefaultPath: false });
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!