Skip to content

Commit 28787e0

Browse files
Added fast connect to index
1 parent 022f2ca commit 28787e0

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

assets/client_test/index.html

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,31 +38,16 @@
3838
HTML_TIMESTAMP: Date.now(),
3939
ALGOLIA_KEY: "aca0d7082e4e63af5ba5917d5e96bed0"
4040
};
41-
// GLOBAL_ENV.MEDIA_PROXY_ENDPOINT = location.protocol + "//" + GLOBAL_ENV.CDN_HOST;
42-
// TODO: remote auth
43-
// window.GLOBAL_ENV.REMOTE_AUTH_ENDPOINT = window.GLOBAL_ENV.GATEWAY_ENDPOINT.replace(/wss?:/, "");
4441
window.localStorage.setItem("gatewayURL", window.GLOBAL_ENV.GATEWAY_ENDPOINT);
4542
window.localStorage.setItem(
4643
"DeveloperOptionsStore",
4744
`{"trace":false,"canary":false,"logGatewayEvents":true,"logOverlayEvents":true,"logAnalyticsEvents":true,"sourceMapsEnabled":false,"axeEnabled":false}`
4845
);
49-
50-
/*
51-
// Not required because slowcord has its own login server
52-
setInterval(() => {
53-
var token = JSON.parse(localStorage.getItem("token"));
54-
if (token) {
55-
var logincss = document.querySelector('#logincss'),
56-
canRemove = logincss ? logincss: "";
57-
if(canRemove !== "") {
58-
document.querySelector("#logincss").remove();
59-
canRemove = "";
60-
}
61-
}
62-
}, 1000)
63-
*/
6446
</script>
6547

48+
<!-- fast connect -->
49+
<script>!function () { if (null != window.WebSocket) { if (function (n) { try { var e = localStorage.getItem(n); return null == e ? null : JSON.parse(e); } catch (n) { return null; } }("token") && !window.__OVERLAY__) { var n = null != window.DiscordNative || null != window.require ? "etf" : "json", e = window.GLOBAL_ENV.GATEWAY_ENDPOINT + "/?encoding=" + n + "&v=" + window.GLOBAL_ENV.API_VERSION + "&compress=zlib-stream"; console.log("[FAST CONNECT] connecting to: " + e); var o = new WebSocket(e); o.binaryType = "arraybuffer"; var t = Date.now(), i = { open: !1, identify: !1, gateway: e, messages: [] }; o.onopen = function () { console.log("[FAST CONNECT] connected in " + (Date.now() - t) + "ms"), i.open = !0; }, o.onclose = o.onerror = function () { window._ws = null; }, o.onmessage = function (n) { i.messages.push(n); }, window._ws = { ws: o, state: i }; } } }();</script>
50+
6651
<!-- preload plugin marker -->
6752
</head>
6853

0 commit comments

Comments
 (0)