-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Open
Description
We should have a document describing the complex interations between Hubs and HttpContext
.
- In a Hub you can get an
HttpContext
viaContext.GetHttpContext()
extension method, but it's not guaranteed to work - Long Polling uses a "simulated" context
- There's no context at all when using Azure SignalR
IHttpContextAccessor
should be avoided- SignalR has some support for non-HTTP transports (nothing officially supported yet but some future ideas) and those wouldn't even have an
HttpContext
so it's considered a good design practice to avoid usingHttpContext
at all inHub
s (to allow portability to non-HTTP transports)
nheath99, stukalin, jiaming0708 and rbgarcia