fix: NVR go2rtc WS mixed-content, K2 재연결 레이스, 시그널링 타임아웃 + WS 프록시 공통화

- nvr-app.html: go2rtc WS URL을 페이지 오리진 기준 상대경로로 (하드코딩된 ws://LAN IP가
  HTTPS 페이지에서 mixed-content로 막히던 문제)
- k2-app.html: 카메라 재연결 시 오래된 연결의 실패 콜백이 새 연결 상태를 덮어쓰던 레이스 수정
- routes-k2.ts: K2 시그널링 fetch에 타임아웃 추가(프린터 응답없음 시 무한대기 방지)
- nvr.ts/routes-comfyui.ts/routes-android.ts에 중복돼있던 raw WebSocket 업그레이드
  프록시(connect→pipe→cleanup)를 ws-proxy-util.ts의 공통 헬퍼로 통합
This commit is contained in:
kim
2026-09-19 23:46:53 +09:00
parent d65e8d958d
commit 5eed244340
7 changed files with 111 additions and 90 deletions
+2 -2
View File
@@ -102,11 +102,11 @@ function connectCam(){
if(res.type==='answer' && pc===camPC){
pc.setRemoteDescription(new RTCSessionDescription(res));
}
}).catch(()=>{ setStatus('연결 실패'); });
}).catch(()=>{ if(pc===camPC) setStatus('연결 실패'); });
}
};
pc.addTransceiver('video',{direction:'sendrecv'});
pc.createOffer().then(d=>pc.setLocalDescription(d)).catch(()=>{ setStatus('연결 실패'); });
pc.createOffer().then(d=>pc.setLocalDescription(d)).catch(()=>{ if(pc===camPC) setStatus('연결 실패'); });
}
function reconnectCam(){ connectCam(); }
connectCam();