Rewrote websocket JS code, tons of stupid.