Skip to content

Commit ac82dd2

Browse files
committed
Update websocket protocol for https
1 parent 70f0ca3 commit ac82dd2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/src/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class App extends Component {
2828
}
2929

3030
// init client websocket
31-
socket = new WebSocket(`ws://${document.location.host}/ws?name=${input}`);
31+
socket = new WebSocket(`${document.location.protocol.replace("http", "ws")}//${document.location.host}/ws?name=${input}`);
3232
socket.onopen = (event) => {
3333
console.log('Opened socket');
3434
};

0 commit comments

Comments
 (0)