Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ export const HotReloadRoot: React.VFC<{ children: React.ReactNode }> = (
// websocket
useEffect(() => {
// e.g ws://localhost:8000
const websocket = new WebSocket(`ws://${window.location.host}`);
const protocol = isSecureContext ? "wss:" : "ws:"
const websocket = new WebSocket(`${protocol}//${window.location.host}`);

// detect local file changes
websocket.onmessage = () => {
Expand Down