We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 90dd631 + 8f79614 commit 9eba38dCopy full SHA for 9eba38d
examples/chat/index.js
@@ -4,7 +4,8 @@
4
// and so we should scroll the next message into view when received.
5
let expectingMessage = false
6
function dial() {
7
- const conn = new WebSocket(`ws://${location.host}/subscribe`)
+ const protocol = location.protocol === 'https' ? 'wss' : ws
8
+ const conn = new WebSocket(`${protocol}://${location.host}/subscribe`)
9
10
conn.addEventListener('close', ev => {
11
appendLog(`WebSocket Disconnected code: ${ev.code}, reason: ${ev.reason}`, true)
0 commit comments