When a web app needs something from an external server, the client sends a request to that server, the server responds, and the connection is subsequently closed. However, bi-directional communication lets the server independently push data to the client every time it updates. This type of connection uses the WebSocket protocol, and today we’ll learn to build a secure WebSocket server using Python and JavaScript.