'Note that this method only makes sense if called in a loop with the
other check_* methods.
:param web_socket_url: The URL of the web socket
:param web_socket_version: The protocol version
:return: True if the web socket is open:
* Any Origin can connect
* No cookies required for authentication
* No basic auth required for authentication'

def check_is_open_web_socket(self, web_socket_url, web_socket_version):

    upgrade_request = build_ws_upgrade_request(web_socket_url, web_socket_version=web_socket_version, origin=self.W3AF_ORIGIN)
    upgrade_response = self._uri_opener.send_mutant(upgrade_request, cookies=False, use_basic_auth=False)
    if (not is_successful_upgrade(upgrade_response)):
        return False
    msg = 'An    HTML5    WebSocket    which    allows    connections    from    any    origin    without    authentication    was    found    at    "%s"'
    msg %= web_socket_url
    v = Vuln.from_fr('Open    WebSocket', msg, severity.LOW, upgrade_response.id, self.get_name(), upgrade_request)
    self.kb_append_uniq(self, 'websocket_hijacking', v)
    return True
