Mercurial
comparison mrjunejune/src/talk/index.html @ 139:e8f693bece90
test again
| author | June Park <parkjune1995@gmail.com> |
|---|---|
| date | Fri, 09 Jan 2026 12:29:20 -0800 |
| parents | 1f023b8bf9c3 |
| children | 276bb3555034 |
comparison
equal
deleted
inserted
replaced
| 138:1f023b8bf9c3 | 139:e8f693bece90 |
|---|---|
| 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 url = host === "mrjunejune.com" ? `ws://${host}/echo` : `ws://${host}:${port}/echo`; |
| 29 const ws = new WebSocket(url); | 29 const ws = new WebSocket(url); |
| 30 const messagesDiv = document.getElementById('messages'); | 30 const messagesDiv = document.getElementById('messages'); |
| 31 | 31 |
| 32 ws.onopen = () => { | 32 ws.onopen = () => { |
| 33 console.log('Connected!'); | 33 console.log('Connected!'); |