I want stream real time data from server to client. We are using Angular 16. I want to intercept the Request and Response of WebSockets, Server Sent Events (SSE) and ReadableStream using Angular Interceptor. Is any one implemented?
Does any one used Angular HttpClientModule and Http interceptor in following HTML5 API's SSE API, WebSockets or Fetch API. I want to stream the real time data from server to client. I implemented one fetch API in the project but that request is not happening through Angular Interceptor. Because Http client module not having the fetch Method. Is anyone extend or override the Angular Client module or Http interceptor?
There is no way to intercept Websockets or Server Send Events with HttpInterceptors. I think you have to implement something by yourself.
For SSE you can create a custom wrapper of EventSource that fit your needs.
For intercepting Websocket send and received messages, i think the only way is to monkey-patch the Websocket-Class