Skip to content

Commit 9eba38d

Browse files
committed
Merge branch 'windows'
2 parents 90dd631 + 8f79614 commit 9eba38d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/chat/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
// and so we should scroll the next message into view when received.
55
let expectingMessage = false
66
function dial() {
7-
const conn = new WebSocket(`ws://${location.host}/subscribe`)
7+
const protocol = location.protocol === 'https' ? 'wss' : ws
8+
const conn = new WebSocket(`${protocol}://${location.host}/subscribe`)
89

910
conn.addEventListener('close', ev => {
1011
appendLog(`WebSocket Disconnected code: ${ev.code}, reason: ${ev.reason}`, true)

0 commit comments

Comments
 (0)