This is not a question about accessing a REST API over a websocket.
I have a REST API which already exists and I'm looking to add websockets that I can send an 'eventId' over in a style similar to google cloud messaging / firebase. This eventId can then be used by clients to access the needed APIs.
The question is where do I define the "ClientManager"?
Currently I'm instantiating the ClientManager in 'Configure' and below am accepting sockets and echoing their data back as a test (as described here: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/websockets?view=aspnetcore-3.1). I'm not sure how to access this instance from elsewhere in the webapp. It seems it should be defined globally. I've found some information on services.AddSingleton but have been unable to get this to work.