[E] WebSocket API

Here are an exercise that will show you how to use one of many HTML APIs.

This exercises provides you with techniques needed to fulfill the assignment A3.

WebSocket API

The example and exercise "Using the WebSocket API" shows how to get going with WebSockets.

Websocket API Figure. This is how the example looks like.

This example is a chat-like application to explore the WebSocket API with focus on the client side code and how to build a client to an existing WebSocket server. You will see how to connect to server, how to use an echo- and a broadcast-server and how to work with subprotocols.

For the server side code we use various servers like Express, Node http-server and ws which is a WebSocket library. The server code is however not focus for this example and is then not explained in any detail in this document.