Improved websocket with sensible idle-timeout and handling of heartbeat
signal