Explore a functional demonstration of RxJs webSocket.
The demonstration encompasses:
A Node.js backend server (server directory) that deploys a WebSocket server. Upon connection, the client receives randomly generated numbers at a default interval of 1 second.
An Angular application (client directory) leveraging webSocket (RxJs) to ingest data via WebSocket. Users have the flexibility to modify the interval. Additionally, the client attempts to reconnect in case of a lost connection.
To set node version for the server and client, run nvm use in both the server and client directories.
Run npm install in both the server and client directories.
To initiate the server, execute npm run start within the server directory.
To launch the client, execute ng serve within the client directory.
This serves as a demonstration utilizing the plain version of WebSocket. In production applications, it is imperative to employ the secure version of the protocol.