def is_websocket(headers):
    """
    Determine whether a given set of headers is asking for WebSockets.
    """

    return ("Upgrade" in headers.get("Connection", "")
            and headers.get("Upgrade").lower() == "websocket")