Reputation: 1
I'm trying to set the protocol for a WebSocket configuration, but I want to do this after receiving an access token from an API. Specifically, I want to pass the token as a header in the Sec-WebSocket-Protocol. However, I haven't been able to set the protocol in any way except by putting it in NgxsWebsocketPluginModule.forRoot().
I also tried using NGXS_WEBSOCKET_OPTIONS by creating a factory, but even though the URL is passed as an option, the protocol is not set in the WebSocket headers. Is there a recommended method to asynchronously set the protocol?
Upvotes: 0
Views: 52