Simple examples of socket client/server written in python.
Simple socket example is written in python 2.7, uses socket
library.
To launch:
python socketserver.py
Taken from: Python Module of The Week
Websocket server is written in python 3.7, websockets
library is used. It requires python 3.4+
To launch:
pip3 install websockets
python3 websocketserver.py