bunch of reworking for WebSockets
flake8