def METHOD_NAME(hostname, port=None, isSecure=False, path=None, params=None):
    """
    Create a WebSocket URL from components.
    :param hostname: WebSocket server hostname (for TCP/IP sockets) or
        filesystem path (for Unix domain sockets).
    :type hostname: str
    :param port: For TCP/IP sockets, WebSocket service port or ``None`` (to select default
        ports ``80`` or ``443`` depending on ``isSecure``. When ``hostname=="unix"``,
        this defines the path to the Unix domain socket instead of a TCP/IP network socket.
    :type port: int or str
    :param isSecure: Set ``True`` for secure WebSocket (``wss`` scheme).
    :type isSecure: bool
    :param path: WebSocket URL path of addressed resource (will be
        properly URL escaped). Ignored for RawSocket.
    :type path: str
    :param params: A dictionary of key-values to construct the query
        component of the addressed WebSocket resource (will be properly URL
        escaped). Ignored for RawSocket.
    :type params: dict
    :returns: Constructed WebSocket URL.
    :rtype: str
    """
    # assert type(hostname) == str
    assert type(isSecure) == bool
    if hostname == 'unix':
        netloc = "unix:%s" % port
    else:
        assert port is None or (type(port) == int and port in range(0, 65535))
        if port is not None:
            netloc = "%s:%d" % (hostname, port)
        else:
            if isSecure:
                netloc = "%s:443" % hostname
            else:
                netloc = "%s:80" % hostname
    if isSecure:
        scheme = "wss"
    else:
        scheme = "ws"
    if path is not None:
        ppath = urlparse.quote(path)
    else:
        ppath = "/"
    if params is not None:
        query = urlparse.urlencode(params)
    else:
        query = None
    return urlparse.urlunparse((scheme, netloc, ppath, None, query, None))