fix: K2 콤보 카메라 STUN 서버 복원 (host candidate만으론 응답 없음)
STUN을 빼고 host candidate만 쓰면 DTLS가 failed로 끝나고 프린터에서 데이터가 전혀 안 옴(bytesReceived 0) — 원인은 불명이나 재현됨. 크리얼리티 데모 코드처럼 STUN을 유지해야 정상 연결됨(다소 느리지만 20초 내외). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PppKcQmeTJDQCpfcgKietu
This commit is contained in:
@@ -76,9 +76,10 @@ function setStatus(t){const s=document.getElementById('cam-status'); if(s) s.tex
|
||||
function connectCam(){
|
||||
if(camPC){ try{camPC.close();}catch(e){} }
|
||||
setStatus('연결 중...');
|
||||
// 같은 LAN 안이라 STUN 없이 host candidate만으로 충분 — 외부 STUN 서버 왕복을
|
||||
// 기다릴 필요가 없고, 그 서버가 막혀있는 네트워크에서도 즉시 연결된다.
|
||||
const pc=new RTCPeerConnection({iceServers:[]});
|
||||
// STUN을 빼면(host candidate만) 이 프린터의 ICE 응답이 실제로는 안 옴(DTLS
|
||||
// failed, bytesReceived 0) — 크리얼리티 데모 코드 그대로 STUN 유지해야 정상
|
||||
// 동작함(2026-09-18 확인, 원인 불명이나 재현됨).
|
||||
const pc=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]});
|
||||
camPC=pc;
|
||||
pc.ontrack=(ev)=>{
|
||||
const v=document.getElementById('k2-cam');
|
||||
|
||||
Reference in New Issue
Block a user