<script async>
    function rwf_turbo_stream_connect() {
        let loc = window.location,
            new_uri;
        if (loc.protocol === "https:") {
            new_uri = "wss:";
        } else {
            new_uri = "ws:";
        }
        new_uri += "//" + loc.host;
        new_uri += "<%- endpoint %>";

        let turbo_stream = document.createElement("turbo-stream-source");
        turbo_stream.setAttribute("src", new_uri);
        document.body.appendChild(turbo_stream);
    }

    rwf_turbo_st