Mercurial
comparison mrjunejune/src/talk/index.html @ 137:095f7dc5bfce
[MrJuneJune] Fix the js file to hit correct endpoints.
| author | June Park <parkjune1995@gmail.com> |
|---|---|
| date | Fri, 09 Jan 2026 11:33:35 -0800 |
| parents | 75c144fd6964 |
| children | 1f023b8bf9c3 |
comparison
equal
deleted
inserted
replaced
| 136:75c144fd6964 | 137:095f7dc5bfce |
|---|---|
| 23 </div> | 23 </div> |
| 24 {{/parts/footer.html}} | 24 {{/parts/footer.html}} |
| 25 <script> | 25 <script> |
| 26 const host = window.location.hostname; | 26 const host = window.location.hostname; |
| 27 const port = '6969'; | 27 const port = '6969'; |
| 28 const url = host === "mrjunejune.com" ? `wss://${host}/echo` : `ws://${host}:${port}/echo`; | |
| 28 const ws = new WebSocket(`ws://${host}:${port}/echo`); | 29 const ws = new WebSocket(`ws://${host}:${port}/echo`); |
| 29 const messagesDiv = document.getElementById('messages'); | 30 const messagesDiv = document.getElementById('messages'); |
| 30 | 31 |
| 31 ws.onopen = () => { | 32 ws.onopen = () => { |
| 32 console.log('Connected!'); | 33 console.log('Connected!'); |