You are probably familiar with the Norse IPViking real-time D3.js attack map (map.ipviking.com). I wanted to learn websockets.
There are two scripts here, one is the websocket server (cut and paste job from opiate's SimpleWebSocketServer), the other is a websocket client (pip websocket-client) which will connect to the server and generate some json payloads compatible with the IPViking D3.js front-end.