Self-hosted Speed Test for HTML5 and more. Easy setup, examples, configurable, mobile friendly. Supports PHP, Node, Multiple servers, and more - librespeed/speedtest
My guess that websocket add additional overhead both in size (header) and complexity as browser and server need to encode/decode it making it more CPU intensive not to mention harder to implement.