master
km0 2 years ago
parent 0f823c7237
commit 8de5337098

@ -11,7 +11,7 @@
<label for="text">Input: </label>
<input type="text" id="text" autofocus />
</form>
<script>
<script defer>
const log = (text, color) => {
document.getElementById(
"log"
@ -20,12 +20,10 @@
console.log(location.protocol);
console.log(
location.protocol == "https:"
? "wss://"
: "ws://" +
location.host +
location.pathname.replace(new RegExp("\/" + "$"), "") +
"/echo/"
(location.protocol == "https:" ? "wss://" : "ws://") +
location.host +
location.pathname.replace(new RegExp("\/" + "$"), "") +
"/echo/"
);
const socket = new WebSocket(

Loading…
Cancel
Save