There is no easy way to set HTTP headers for SignalR requests using the JS or .NET client, but you can add parameters to the query string that will be sent as part of each SignalR request: JS Client
.NET Client
Inside a Hub you can access the community name through the Context:
You can add to the query string when making persistent connections as well. EDIT: It is now possible to set headers on the .NET SignalR client as pointed out by some of the commenters. Setting Headers on the .NET Client
|
|
来自: ThinkTank_引擎 > 《SignalR》