Added preliminary detection of WebSockets to avoid auto-closing the connection.
Still need to keep communicating.