improved websockets detection