def create_url(hostname, port=None, isSecure=False):
    """
    Create a RawSocket URL from components.

    :param hostname: RawSocket server hostname (for TCP/IP sockets) or
        filesystem path (for Unix domain sockets).
    :type hostname: str

    :param port: For TCP/IP sockets, RawSocket 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 RawSocket (``rss`` scheme).
    :type isSecure: bool

    :returns: Constructed RawSocket 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 = "{}:443".format(hostname)
            else:
                netloc = "{}:80".format(hostname)

    if isSecure:
        scheme = "rss"
    else:
        scheme = "rs"

    return "{}://{}".format(scheme, netloc)