ICE ( Interactive Connectivity Establishment ) 프레임워크로 STUN, TURN 서버를 통해 상대 Peer에 유동적으로 연결
프론트엔드 구조 : client/ 내부의 순수 HTML, JS, CSS 기반 SPA
데스크탑, 모바일별 별도 레이아웃 제공
방 번호 입력부분 랜덤 버튼 클릭시 랜덤 UUID 생성 후 자동으로 서버에 중복확인 요청
랜덤 대신 수동으로 직접 입력도 가능
WebRTC DataChannel을 통해 텍스트 기반 통신 활용
우측 상단 버튼을 통해 해당 화면 진입시 PIP모드가 가능한 환경일경우 PIP 모드 실행
npm install
npm run build현재 폴더 구조는 client/와 server/로 분리되어 있습니다.
client/src/WebRTC.tsclient/publicclient/distserver/app.jsserver/db.jsserver/schema.sql
npm install
npm run build:android
npm run cap:open:android1-1. HTML, JS, CSS 파일 요청 처리
1-2. PWA ( Progessive Web App ) 적용을 위한 manifest.json 파일 요청 처리
1-3. 추가 PWA asset ( 앱 아이콘, 스크린샷 등 ) 파일 요청 처리
1-4. .well-known 내부 파일 요청 처리
2-1. Room 사용자들의 WebRTC SDP ( Session Description Protocol : offer / answer / candidate ) 교환
2-2. 기타 정보 ( login, logout, randomCheck ) 교환
{type, from, to, data} 형태로 메세지를 보내고 받음
예시)
offer) => to 방의 모든 사용자
{ type: 'offer', from: 'my-sessionId', to: '', data: 'WebRTC offer' }
answer) => to 방의 특정 사용자
{ type: 'answer', from: 'my-sessionId', to: 'target-sessionId', data: 'WebRTC answer' }
candidate) => to 방의 특정 사용자
{ type: 'candidate', from: 'my-sessionId', to: 'target-sessionId', data: 'WebRTC candidate' }
※STUN 서버는 클라이언트 측에서 Google의 STUN 서버를 우선 사용
( /SSL 폴더에 cert.pem, privkey.pem 파일이 필요합니다. - HTTPS 서버용 키 / 별도 발급 필요 )
npm install
node server/app.jsGoogle OAuth, 회원 DB, 지문등록은 백엔드에서 다음 순서로 준비합니다.
.env.example을 기준으로.env작성- MySQL에
schema.sql적용 - Google Cloud Console에서 OAuth 클라이언트 생성
GOOGLE_REDIRECT_URI,WEBAUTHN_RP_ID,WEBAUTHN_ORIGIN을 실제 도메인으로 설정SESSION_COOKIE_NAME,SESSION_TTL_DAYS를 설정
cp .env.example .env
mysql -u root -p < server/schema.sql
node server/app.jsGET /auth/google/startGoogle OAuth 로그인 시작GET /auth/google/callbackGoogle code 교환 후 회원 생성 또는 갱신, session cookie 설정GET /auth/mesession cookie 기준 현재 회원 조회POST /auth/logout현재 session cookie 만료
서버는 원본 지문을 저장하지 않습니다. WebAuthn credential만 저장합니다.
POST /auth/webauthn/register/optionssession cookie 필요POST /auth/webauthn/register/verifysession cookie 필요 request body는 브라우저/앱에서 생성한 WebAuthn registration credential 전체 JSON
