Mercurial
comparison mrjunejune/src/talk/index.html @ 143:276bb3555034
Should work now.
| author | June Park <parkjune1995@gmail.com> |
|---|---|
| date | Fri, 09 Jan 2026 13:13:27 -0800 |
| parents | e8f693bece90 |
| children | c1eab8c0b0f9 |
comparison
equal
deleted
inserted
replaced
| 142:893d87124d16 | 143:276bb3555034 |
|---|---|
| 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" ? `ws://${host}/echo` : `ws://${host}:${port}/echo`; | 28 const url = host === "mrjunejune.com" ? `wss://${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!'); |