function getWebsocketProtocol() {
    // return "ws://" when localhost or "wss://"
    const hostname = window.location.hostname;
    if (hostname === "localhost" || hostname === "127.0.0.1") {
        return "ws://";
    } else {
        return "wss://";
    }
}
