[SignalR]配置路由

时间:2023-03-09 20:16:33
[SignalR]配置路由

原文:[SignalR]配置路由

注册路由,在代码如下(SignalR 1.*):

[SignalR]配置路由

脚本修改如下:

[SignalR]配置路由

但是其官方文档解释是:

By default, the route URL which clients will use to connect to your Hub is "/signalr". (Don't confuse this URL with the "/signalr/hubs" URL, which is for the automatically generated JavaScript file. For more information about the generated proxy, see  SignalR Hubs API Guide - JavaScript Client - The generated proxy and what it does for you .)
There might be extraordinary circumstances that make this base URL not usable for SignalR; for example, you have a folder in your project named signalr and you don't want to change the name. In that case, you can change the base URL, as shown in the following examples (replace "/signalr" in the sample code with your desired URL).

参考链接:http://www.asp.net/signalr/overview/hubs-api/hubs-api-guide-server#route