protocol detection
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Michael Zhang 2023-02-11 15:28:33 -06:00
parent b8ceb2ed34
commit 8bbecaa7b7
2 changed files with 12 additions and 1 deletions

View file

@ -36,6 +36,7 @@ pipeline:
- podman login git.mzhang.io --username michael --password $DOCKER_TOKEN
- podman push $REPO:$TAG
- podman push $REPO:latest
- exit 1
secrets:
- DOCKER_TOKEN
volumes:
@ -43,3 +44,4 @@ pipeline:
when:
# event: tag
branch: master

View file

@ -34,7 +34,16 @@
// Connect to websocket
let roomId = "{{ room_id }}";
let ws = new WebSocket(`ws://${location.host}/ws/${roomId}`);
let protocol;
switch (location.protocol) {
case "https:":
protocol = "wss:";
case "http:":
protocol = "ws:";
default:
throw new Error("L");
}
let ws = new WebSocket(`${protocol}//${location.host}/ws/${roomId}`);
// Relay all messages to terminal
ws.addEventListener("message", (msg) => {