Use ReadableStream api do realtime communication(Websocket likely), based on fetch api.
Use readableStream api mock socket