In the following sections, we will look at the client side. On the client side, we have to initiate the web socket connection with the server, send a CartEvent when a product is added or removed from the cart, and show alerts when other browsers make changes to the cart.
First, let's create the connection with the server using a web socket.