mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 03:29:16 +00:00
allowing for unfederated http
This commit is contained in:
parent
f660ea6292
commit
e70a02f53a
@ -123,7 +123,15 @@ export function useAppContext() {
|
|||||||
cardContext.actions.setToken(token);
|
cardContext.actions.setToken(token);
|
||||||
channelContext.actions.setToken(token);
|
channelContext.actions.setToken(token);
|
||||||
|
|
||||||
ws.current = new WebSocket("wss://" + window.location.host + "/status");
|
let protocol;
|
||||||
|
if (window.location.protocol === 'http') {
|
||||||
|
protocol = 'ws://';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
protocol = 'wss://';
|
||||||
|
}
|
||||||
|
|
||||||
|
ws.current = new WebSocket(protocol + window.location.host + "/status");
|
||||||
ws.current.onmessage = (ev) => {
|
ws.current.onmessage = (ev) => {
|
||||||
try {
|
try {
|
||||||
let rev = JSON.parse(ev.data);
|
let rev = JSON.parse(ev.data);
|
||||||
|
Loading…
Reference in New Issue
Block a user