mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-02 14:19:56 +00:00
fix(ui): use wss:// for WebSocket on HTTPS pages (#315)
This commit is contained in:
@@ -69,7 +69,8 @@ export function useWebSocket() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setStatus('connecting');
|
setStatus('connecting');
|
||||||
const ws = new WebSocket(`ws://${window.location.host}`);
|
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
|
||||||
|
const ws = new WebSocket(`${protocol}//${window.location.host}`);
|
||||||
wsRef.current = ws;
|
wsRef.current = ws;
|
||||||
|
|
||||||
ws.onopen = () => {
|
ws.onopen = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user