Skip to content

๐ŸŽข WebRTC Mesh โ€ ํ—˜๋‚œํ•œ ์—ฌ์ •

Taewon Kim edited this page Nov 12, 2024 · 2 revisions
Sequence Diagram(Two Clients) ์ ‘๊ธฐ/ํŽผ์น˜๊ธฐ
sequenceDiagram
    participant C1 as Client 1
    participant SS as Signaling Server
    participant C2 as Client 2

    Note over C1,C2: 1. ์Œ์„ฑ ์ฑ„ํŒ…๋ฐฉ ์ž…์žฅ ๋‹จ๊ณ„

    C1->>C1: Request microphone permission
    activate C1
    Note right of C1: getUserMedia()๋กœ<br/>๋งˆ์ดํฌ ๊ถŒํ•œ ์š”์ฒญ
    C1-->>C1: Setup local stream
    deactivate C1

    C1->>SS: join_room
    activate SS
    Note right of SS: ๋ฐฉ ์ •๋ณด์— Client 1 ์ถ”๊ฐ€
    SS-->>C1: room_info
    deactivate SS
    Note right of C1: ๋ฐฉ ์ •๋ณด ์ˆ˜์‹ <br/>(ํ˜„์žฌ๋Š” Client 1๋งŒ ์กด์žฌ)

    C1->>SS: room_info_received
    Note right of SS: Client 1์ด ๋ฐฉ ์ •๋ณด๋ฅผ<br/>์ •์ƒ์ ์œผ๋กœ ์ˆ˜์‹ ํ–ˆ์Œ์„ ํ™•์ธ

    Note over C1,C2: 2. ๋‘ ๋ฒˆ์งธ ์‚ฌ์šฉ์ž ์ž…์žฅ

    C2->>C2: Request microphone permission
    activate C2
    Note right of C2: getUserMedia()๋กœ<br/>๋งˆ์ดํฌ ๊ถŒํ•œ ์š”์ฒญ
    C2-->>C2: Setup local stream
    deactivate C2

    C2->>SS: join_room
    activate SS
    Note right of SS: ๋ฐฉ ์ •๋ณด์— Client 2 ์ถ”๊ฐ€
    SS-->>C1: room_info
    SS-->>C2: room_info
    deactivate SS
    Note right of C2: ์—…๋ฐ์ดํŠธ๋œ ๋ฐฉ ์ •๋ณด ์ˆ˜์‹ <br/>(Client 1, 2 ์ •๋ณด ํฌํ•จ)

    C1->>SS: room_info_received
    C2->>SS: room_info_received
    Note right of SS: ๋ชจ๋“  ํด๋ผ์ด์–ธํŠธ๊ฐ€<br/>๋ฐฉ ์ •๋ณด๋ฅผ ์ˆ˜์‹ ํ–ˆ์Œ์„ ํ™•์ธ

    Note over C1,C2: 3. P2P ์—ฐ๊ฒฐ ์‹œ์ž‘

    SS->>C1: start_connections
    SS->>C2: start_connections
    Note right of SS: ์„œ๋ฒ„๊ฐ€ ์—ฐ๊ฒฐ ๊ณ„ํš ์ „์†ก<br/>(๋ˆ„๊ฐ€ ๋ˆ„๊ตฌ์—๊ฒŒ Offerํ• ์ง€)

    Note over C1,C2: 4. WebRTC ์‹œ๊ทธ๋„๋ง ๋‹จ๊ณ„

    C1->>C1: Create RTCPeerConnection
    activate C1
    Note right of C1: STUN/TURN ์„œ๋ฒ„ ์„ค์ •<br/>๋กœ์ปฌ ์ŠคํŠธ๋ฆผ ์ถ”๊ฐ€
    C1-->>C1: Create Offer
    deactivate C1

    C1->>SS: webrtc_offer
    SS->>C2: webrtc_offer
    Note right of C2: Offer SDP ์ˆ˜์‹ 

    C2->>C2: Create RTCPeerConnection
    activate C2
    Note right of C2: STUN/TURN ์„œ๋ฒ„ ์„ค์ •<br/>๋กœ์ปฌ ์ŠคํŠธ๋ฆผ ์ถ”๊ฐ€
    C2-->>C2: Create Answer
    deactivate C2

    C2->>SS: webrtc_answer
    SS->>C1: webrtc_answer
    Note right of C1: Answer SDP ์ˆ˜์‹ 

    Note over C1,C2: 5. ICE Candidate ๊ตํ™˜

    par ICE Candidate Exchange
        C1->>SS: webrtc_ice_candidate
        SS->>C2: webrtc_ice_candidate
    and
        C2->>SS: webrtc_ice_candidate
        SS->>C1: webrtc_ice_candidate
    end
    Note over C1,C2: ์–‘๋ฐฉํ–ฅ ICE Candidate ๊ตํ™˜<br/>์ตœ์ ์˜ ๋„คํŠธ์›Œํฌ ๊ฒฝ๋กœ ์„ค์ •

    Note over C1,C2: 6. P2P ์—ฐ๊ฒฐ ์™„๋ฃŒ

    par Media Stream Exchange
        C1-->>C2: Send audio stream
        C2-->>C1: Send audio stream
    end
    Note over C1,C2: ์–‘๋ฐฉํ–ฅ ์Œ์„ฑ ์ŠคํŠธ๋ฆผ ์ „์†ก ์‹œ์ž‘<br/>์‹ค์‹œ๊ฐ„ ์Œ์„ฑ ํ†ตํ™” ๊ฐ€๋Šฅ

    Note over C1,C2: 7. ์—ฐ๊ฒฐ ์ƒํƒœ ๋ชจ๋‹ˆํ„ฐ๋ง

    loop Connection Monitoring
        C1->>C1: Monitor connection state
        C2->>C2: Monitor connection state
        Note over C1,C2: connectionStateChange,<br/>iceConnectionStateChange<br/>์ด๋ฒคํŠธ ๋ชจ๋‹ˆํ„ฐ๋ง
    end

    Note over C1,C2: 8. ์‚ฌ์šฉ์ž ํ‡ด์žฅ ์‹œ๋‚˜๋ฆฌ์˜ค

    C2->>SS: disconnect
    activate SS
    SS-->>C1: user_disconnected
    deactivate SS

    C1->>C1: Clean up connection
    activate C1
    Note right of C1: Peer Connection ์ •๋ฆฌ<br/>์˜ค๋””์˜ค ์—˜๋ฆฌ๋จผํŠธ ์ œ๊ฑฐ
    deactivate C1
Loading
Sequence Diagram(Three Clients) ์ ‘๊ธฐ/ํŽผ์น˜๊ธฐ
sequenceDiagram
    participant C1 as Client 1
    participant SS as Signaling Server
    participant C2 as Client 2
    participant C3 as Client 3

    Note over C1,C2: 1. ์ดˆ๊ธฐ ๋‘ ํด๋ผ์ด์–ธํŠธ ์—ฐ๊ฒฐ ์ˆ˜๋ฆฝ

    C1->>SS: join_room
    Note right of SS: Client 1 ๋ฐฉ ์ฐธ๊ฐ€
    SS-->>C1: room_info
    C1->>SS: room_info_received

    C2->>SS: join_room
    Note right of SS: Client 2 ๋ฐฉ ์ฐธ๊ฐ€
    SS-->>C1: room_info
    SS-->>C2: room_info
    C1->>SS: room_info_received
    C2->>SS: room_info_received

    SS->>C1: start_connections
    SS->>C2: start_connections
    Note right of SS: C1 โ†” C2 ์—ฐ๊ฒฐ ๊ณ„ํš ์ „์†ก

    Note over C1,C2: WebRTC C1 โ†” C2 ์—ฐ๊ฒฐ ์ˆ˜๋ฆฝ

    C1->>SS: webrtc_offer (to C2)
    SS->>C2: webrtc_offer (from C1)
    C2->>SS: webrtc_answer (to C1)
    SS->>C1: webrtc_answer (from C2)

    par ICE Candidate Exchange C1 โ†” C2
        C1->>SS: ice_candidate (to C2)
        SS->>C2: ice_candidate (from C1)
    and
        C2->>SS: ice_candidate (to C1)
        SS->>C1: ice_candidate (from C2)
    end

    Note over C1,C2: C1 โ†” C2 P2P ์—ฐ๊ฒฐ ์™„๋ฃŒ

    Note over C1,C3: 2. ์„ธ ๋ฒˆ์งธ ํด๋ผ์ด์–ธํŠธ ์ž…์žฅ

    C3->>SS: join_room
    Note right of SS: Client 3 ๋ฐฉ ์ฐธ๊ฐ€
    SS-->>C1: room_info
    SS-->>C2: room_info
    SS-->>C3: room_info
    Note right of SS: 3๋ช…์˜ ํด๋ผ์ด์–ธํŠธ ์ •๋ณด ํฌํ•จ

    C1->>SS: room_info_received
    C2->>SS: room_info_received
    C3->>SS: room_info_received

    SS->>C1: start_connections
    SS->>C2: start_connections
    SS->>C3: start_connections
    Note right of SS: C1 โ†” C3, C2 โ†” C3<br/>์ƒˆ๋กœ์šด ์—ฐ๊ฒฐ ๊ณ„ํš ์ „์†ก

    Note over C1,C3: WebRTC C1 โ†” C3 ์—ฐ๊ฒฐ ์ˆ˜๋ฆฝ

    C1->>SS: webrtc_offer (to C3)
    SS->>C3: webrtc_offer (from C1)
    C3->>SS: webrtc_answer (to C1)
    SS->>C1: webrtc_answer (from C3)

    par ICE Candidate Exchange C1 โ†” C3
        C1->>SS: ice_candidate (to C3)
        SS->>C3: ice_candidate (from C1)
    and
        C3->>SS: ice_candidate (to C1)
        SS->>C1: ice_candidate (from C3)
    end

    Note over C2,C3: WebRTC C2 โ†” C3 ์—ฐ๊ฒฐ ์ˆ˜๋ฆฝ

    C2->>SS: webrtc_offer (to C3)
    SS->>C3: webrtc_offer (from C2)
    C3->>SS: webrtc_answer (to C2)
    SS->>C2: webrtc_answer (from C3)

    par ICE Candidate Exchange C2 โ†” C3
        C2->>SS: ice_candidate (to C3)
        SS->>C3: ice_candidate (from C2)
    and
        C3->>SS: ice_candidate (to C2)
        SS->>C2: ice_candidate (from C3)
    end

    Note over C1,C3: 3๋ช…์˜ Full Mesh P2P ์—ฐ๊ฒฐ ์™„๋ฃŒ

    Note over C1,C3: 3. Client 2 ํ‡ด์žฅ

    C2->>SS: disconnect
    Note right of SS: Client 2 ์—ฐ๊ฒฐ ํ•ด์ œ ์ฒ˜๋ฆฌ

    SS-->>C1: user_disconnected (C2)
    SS-->>C3: user_disconnected (C2)

    par Connection Cleanup
        C1->>C1: Clean up C2 connection
        Note right of C1: - C2์™€์˜ Peer Connection ์ข…๋ฃŒ<br/>- C2์˜ ์˜ค๋””์˜ค ์—˜๋ฆฌ๋จผํŠธ ์ œ๊ฑฐ
    and
        C3->>C3: Clean up C2 connection
        Note right of C3: - C2์™€์˜ Peer Connection ์ข…๋ฃŒ<br/>- C2์˜ ์˜ค๋””์˜ค ์—˜๋ฆฌ๋จผํŠธ ์ œ๊ฑฐ
    end

    SS-->>C1: room_info
    SS-->>C3: room_info
    Note right of SS: 2๋ช…์˜ ํด๋ผ์ด์–ธํŠธ ์ •๋ณด๋กœ ์—…๋ฐ์ดํŠธ

    C1->>SS: room_info_received
    C3->>SS: room_info_received

    Note over C1,C3: C1 โ†” C3 P2P ์—ฐ๊ฒฐ ์œ ์ง€<br/>2๋ช…์˜ ํด๋ผ์ด์–ธํŠธ๋กœ ์Œ์„ฑ ์ฑ„ํŒ… ๊ณ„์†
Loading

WebRTC ๊ธฐ๋ฐ˜์˜ ์Œ์„ฑ ํ†ตํ™” ์„œ๋น„์Šค๋ฅผ ๊ฐœ๋ฐœํ•˜๋ฉด์„œ, ์ €ํฌ๋Š” Mesh ๋ฐฉ์‹์„ ์„ ํƒํ•˜๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

Mesh ๋ฐฉ์‹์„ ์„ ํƒํ•œ ์ด์œ ์™€ ๊ทผ๊ฑฐ๋Š” ๐Ÿ“Š WebRTC Mesh โ€ ํŠธ๋ž˜ํ”ฝ ๊ณ„์‚ฐ์„ ์ฐธ๊ณ ํ•ด ์ฃผ์„ธ์š”!

์ด ๊ธ€์—์„œ๋Š” ๊ฐœ๋ฐœ ๊ณผ์ •์—์„œ ์–ด๋–ค ์–ด๋ ค์›€์ด ์žˆ์—ˆ๋Š”์ง€, ์–ด๋–ป๊ฒŒ ํ•ด๊ฒฐํ–ˆ๋Š”์ง€๋ฅผ ๊ณต์œ ํ•˜๊ณ ์ž ํ•ฉ๋‹ˆ๋‹ค.

๊ฒช์—ˆ๋˜ ๋ฌธ์ œ๋“ค ๐Ÿž

๊ฐœ๋ฐœ์„ ์ง„ํ–‰ํ•˜๋ฉด์„œ ์˜ˆ์ƒ์น˜ ๋ชปํ•œ ๋ฌธ์ œ๋“ค์ด ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค.

1. 3๋ช… ์ด์ƒ์˜ ์‚ฌ์šฉ์ž ์—ฐ๊ฒฐ ๋ถˆ์•ˆ์ • ๐Ÿ˜ต

  • ์ƒˆ๋กœ์šด ์‚ฌ์šฉ์ž๊ฐ€ ๋“ค์–ด์˜ค๊ฑฐ๋‚˜ ๊ธฐ์กด ์‚ฌ์šฉ์ž๊ฐ€ ๋‚˜๊ฐ€๋Š” ๋“ฑ ๋ณ€ํ™”๊ฐ€ ์ง€์†์ ์œผ๋กœ ๋ฐœ์ƒํ•˜๋Š” ์ƒํ™ฉ์—์„œ Mesh ๋„คํŠธ์›Œํฌ์˜ ์•ˆ์ •์„ฑ์ด ๋–จ์–ด์ง€๋Š” ๋ฌธ์ œ๊ฐ€ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.
  • ํŠนํžˆ, ํƒ€์ด๋ฐ ์ด์Šˆ๋กœ ์ธํ•ด ์—ฐ๊ฒฐ ์„ค์ • ๋ฐ ํ•ด์ œ๊ฐ€ ์ œ๋Œ€๋กœ ์ด๋ฃจ์–ด์ง€์ง€ ์•Š๋Š” ๊ฒฝ์šฐ๊ฐ€ ๋นˆ๋ฒˆํ–ˆ์Šต๋‹ˆ๋‹ค.

2. ๋ชจ๋ฐ”์ผ ๋„คํŠธ์›Œํฌ์—์„œ์˜ ์ž‘๋™ ๋ถˆ๊ฐ€ ๐Ÿ“ต

  • LTE๋‚˜ 5G์™€ ๊ฐ™์€ ๋ชจ๋ฐ”์ผ ๋„คํŠธ์›Œํฌ์—์„œ๋Š” ์„œ๋น„์Šค๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ๋™์ž‘ํ•˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.
  • ์ด๋Š” ISP์˜ ๋ฐฉํ™”๋ฒฝ ๋ฌธ์ œ๋กœ ์ถ”์ธก๋˜์—ˆ์œผ๋ฉฐ, TURN ์„œ๋ฒ„์˜ ํ•„์š”์„ฑ์„ ๋Š๋ผ๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

3. ๋ฐฉ์žฅ ์žฌ์ ‘์† ์‹œ ์—ฐ๊ฒฐ ๋Š๊น€ ๐Ÿ”Œ

  • ๋ฐฉ์„ ๊ฐœ์„คํ•œ ์‚ฌ์šฉ์ž๊ฐ€ ์žฌ์ ‘์†ํ•˜๋ฉด ๋ชจ๋“  ์—ฐ๊ฒฐ์ด ๋Š๊ธฐ๋Š” ํ˜„์ƒ์ด ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค.
  • ์ด๋Š” ๋ฐฉ์žฅ์—๊ฒŒ ํŠน์ • ๊ถŒํ•œ์ด๋‚˜ ์—ญํ• ์ด ๋ถ€์—ฌ๋˜์–ด ์žˆ์–ด ๋ฐœ์ƒํ•œ ๋ฌธ์ œ๋กœ ํŒ๋‹จ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

๋ฌธ์ œ ํ•ด๊ฒฐ ๊ณผ์ • ๐Ÿ› 

Coturn์„ ํ™œ์šฉํ•œ STUN/TURN ์„œ๋ฒ„ ๊ตฌ์ถ• ๐Ÿ›ฐ

๋ชจ๋ฐ”์ผ ๋„คํŠธ์›Œํฌ์—์„œ์˜ ์—ฐ๊ฒฐ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด Coturn์„ ํ™œ์šฉํ•˜์—ฌ ์ž์ฒด์ ์ธ STUN/TURN ์„œ๋ฒ„๋ฅผ ๊ตฌ์ถ•ํ–ˆ์Šต๋‹ˆ๋‹ค. ์ด๋ฅผ ํ†ตํ•ด NAT ๋ฐฉํ™”๋ฒฝ์„ ์šฐํšŒํ•˜์—ฌ ๋ชจ๋ฐ”์ผ ๋„คํŠธ์›Œํฌ์—์„œ๋„ ์•ˆ์ •์ ์ธ ์—ฐ๊ฒฐ์ด ๊ฐ€๋Šฅํ•ด์กŒ์Šต๋‹ˆ๋‹ค.

๋กœ์ง ๊ฐœ์„  ๋ฐ ์ˆ˜์‹  ํ™•์ธ ์ถ”๊ฐ€ ๐Ÿ“

  • ํƒ€์ด๋ฐ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด ์ „์ฒด์ ์ธ ์‹œ๊ทธ๋„๋ง ๋กœ์ง์„ ๊ฐœ์„ ํ–ˆ์Šต๋‹ˆ๋‹ค.
  • ํด๋ผ์ด์–ธํŠธ์™€ ์„œ๋ฒ„ ๊ฐ„์— ์ˆ˜์‹  ํ™•์ธ(ACK) ๋ฉ”์ปค๋‹ˆ์ฆ˜์„ ๋„์ž…ํ•˜์—ฌ ๋ฉ”์‹œ์ง€ ์ „๋‹ฌ์˜ ์‹ ๋ขฐ์„ฑ์„ ๋†’์˜€์Šต๋‹ˆ๋‹ค.
  • ์ด๋ฅผ ํ†ตํ•ด ์ƒˆ๋กœ์šด ์‚ฌ์šฉ์ž์˜ ์ž…์žฅ์ด๋‚˜ ๊ธฐ์กด ์‚ฌ์šฉ์ž์˜ ํ‡ด์žฅ ์‹œ ๋ฐœ์ƒํ•˜๋˜ ๋ถˆ์•ˆ์ •์„ฑ์„ ํ•ด์†Œํ–ˆ์Šต๋‹ˆ๋‹ค.

๋ฐฉ์žฅ ๊ฐœ๋… ์ œ๊ฑฐ ๐Ÿšซ

  • ๋ฐฉ์žฅ์—๊ฒŒ ๋ถ€์—ฌ๋œ ํŠน๋ณ„ํ•œ ์—ญํ• ์„ ์ œ๊ฑฐํ•˜์—ฌ ๋ชจ๋“  ์‚ฌ์šฉ์ž๊ฐ€ ๋Œ€๋“ฑํ•œ ์—ญํ• ์„ ๊ฐ€์ง€๋„๋ก ๋ณ€๊ฒฝํ–ˆ์Šต๋‹ˆ๋‹ค.
  • ์ด๋ฅผ ํ†ตํ•ด ๋ฐฉ์žฅ์ด ์žฌ์ ‘์†ํ•˜๊ฑฐ๋‚˜ ํ‡ด์žฅํ•˜๋”๋ผ๋„ ์ „์ฒด ์—ฐ๊ฒฐ์— ์˜ํ–ฅ์„ ์ฃผ์ง€ ์•Š๋„๋ก ๊ฐœ์„ ํ–ˆ์Šต๋‹ˆ๋‹ค.

๊ฐœ์„ ๋œ ์—ฐ๊ฒฐ ํ๋ฆ„ ๐Ÿ“ˆ

๊ฐœ์„ ๋œ ๋กœ์ง์— ๋”ฐ๋ผ WebRTC P2P Mesh ์Œ์„ฑ ํ†ตํ™”์˜ ์ „์ฒด์ ์ธ ํ๋ฆ„์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

  1. ํด๋ผ์ด์–ธํŠธ ์ดˆ๊ธฐํ™”: ๊ฐ ํด๋ผ์ด์–ธํŠธ๋Š” ๋งˆ์ดํฌ ๊ถŒํ•œ์„ ์š”์ฒญํ•˜๊ณ  ๋กœ์ปฌ ์ŠคํŠธ๋ฆผ์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.
  2. ๋ฐฉ ์ฐธ๊ฐ€: ์‹œ๊ทธ๋„๋ง ์„œ๋ฒ„์— join_room ์ด๋ฒคํŠธ๋ฅผ ํ†ตํ•ด ๋ฐฉ ์ฐธ๊ฐ€๋ฅผ ์š”์ฒญํ•ฉ๋‹ˆ๋‹ค.
  3. ๋ฐฉ ์ •๋ณด ์ˆ˜์‹  ๋ฐ ํ™•์ธ: ์„œ๋ฒ„๋กœ๋ถ€ํ„ฐ ๋ฐฉ ์ •๋ณด๋ฅผ ์ˆ˜์‹ ํ•˜๊ณ  room_info_received ์ด๋ฒคํŠธ๋กœ ์ˆ˜์‹  ํ™•์ธ์„ ๋ณด๋ƒ…๋‹ˆ๋‹ค.
  4. P2P ์—ฐ๊ฒฐ ์„ค์ •: ์„œ๋ฒ„๋กœ๋ถ€ํ„ฐ start_connections ์ด๋ฒคํŠธ๋ฅผ ๋ฐ›์•„ ์—ฐ๊ฒฐ ๊ณ„ํš์— ๋”ฐ๋ผ Offer/Answer ๊ตํ™˜์„ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค. ์—ฐ๊ฒฐ ๊ณ„ํš์—๋Š” ์–ด๋–ค ํด๋ผ์ด์–ธํŠธ๊ฐ€(From) ์–ด๋–ค ํด๋ผ์ด์–ธํŠธ(To)์—๊ฒŒ Offer๋ฅผ ๋ณด๋‚ผ์ง€๊ฐ€ ๋ช…์‹œ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.
  5. ICE Candidate ๊ตํ™˜: P2P ์—ฐ๊ฒฐ์„ ์œ„ํ•œ ์ตœ์ ์˜ ๊ฒฝ๋กœ๋ฅผ ์„ค์ •ํ•˜๊ธฐ ์œ„ํ•ด ICE Candidate๋ฅผ ๊ตํ™˜ํ•ฉ๋‹ˆ๋‹ค.
  6. ๋ฏธ๋””์–ด ์ŠคํŠธ๋ฆผ ๊ตํ™˜: ์—ฐ๊ฒฐ์ด ์™„๋ฃŒ๋˜๋ฉด ์–‘๋ฐฉํ–ฅ์œผ๋กœ ์Œ์„ฑ ์ŠคํŠธ๋ฆผ์„ ์ „์†กํ•˜์—ฌ ์‹ค์‹œ๊ฐ„ ํ†ตํ™”๊ฐ€ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.
  7. ์—ฐ๊ฒฐ ์ƒํƒœ ๋ชจ๋‹ˆํ„ฐ๋ง: ๊ฐ ํด๋ผ์ด์–ธํŠธ๋Š” ์—ฐ๊ฒฐ ์ƒํƒœ์™€ ICE ์ƒํƒœ ๋ณ€ํ™”๋ฅผ ๋ชจ๋‹ˆํ„ฐ๋งํ•˜์—ฌ ์—ฐ๊ฒฐ์ด ๋Š์–ด์ง€๋ฉด ์žฌ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.
  8. ์‚ฌ์šฉ์ž ํ‡ด์žฅ ์ฒ˜๋ฆฌ: ์‚ฌ์šฉ์ž๊ฐ€ ํ‡ด์žฅํ•˜๋ฉด user_disconnected ์ด๋ฒคํŠธ๋ฅผ ํ†ตํ•ด ๋‹ค๋ฅธ ํด๋ผ์ด์–ธํŠธ๊ฐ€ ํ•ด๋‹น ์‚ฌ์šฉ์ž์™€์˜ ์—ฐ๊ฒฐ์„ ์ •๋ฆฌํ•ฉ๋‹ˆ๋‹ค.

๊ฒฐ๋ก  ๐ŸŽ‰

WebRTC P2P Mesh ๋ฐฉ์‹์„ ํ™œ์šฉํ•œ ์Œ์„ฑ ํ†ตํ™” ์„œ๋น„์Šค๋ฅผ ๊ตฌํ˜„ํ•˜๋ฉด์„œ ๋งŽ์€ ์–ด๋ ค์›€์ด ์žˆ์—ˆ์ง€๋งŒ, ์ง€์†์ ์ธ ๋ฌธ์ œ ํ•ด๊ฒฐ๊ณผ ๋กœ์ง ๊ฐœ์„ ์„ ํ†ตํ•ด ์•ˆ์ •์ ์ธ ์„œ๋น„์Šค๋ฅผ ์ œ๊ณตํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ํŠนํžˆ, Coturn์„ ํ™œ์šฉํ•œ STUN/TURN ์„œ๋ฒ„ ๊ตฌ์ถ•๊ณผ ํƒ€์ด๋ฐ ๋ฌธ์ œ ํ•ด๊ฒฐ์„ ์œ„ํ•œ ๋กœ์ง ๊ฐœ์„ ์ด ํฐ ์—ญํ• ์„ ํ–ˆ์Šต๋‹ˆ๋‹ค.

์ด๋ฒˆ ๊ฒฝํ—˜์„ ํ†ตํ•ด ์‹ค์‹œ๊ฐ„ ํ†ต์‹  ์„œ๋น„์Šค์—์„œ์˜ ๋„คํŠธ์›Œํฌ ํ™˜๊ฒฝ๊ณผ ํ”„๋กœํ† ์ฝœ์˜ ์ค‘์š”์„ฑ์„ ๋‹ค์‹œ ํ•œ๋ฒˆ ๋Š๋‚„ ์ˆ˜ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.

๐Ÿ™ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค

์—ฌ๊ธฐ๊นŒ์ง€ ์ฝ์–ด์ฃผ์…”์„œ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค! ํ˜น์‹œ ๋น„์Šทํ•œ ๋ฌธ์ œ๋ฅผ ๊ฒช๊ณ  ๊ณ„์‹œ๋‹ค๋ฉด ์ด ๊ธ€์ด ๋„์›€์ด ๋˜์—ˆ์œผ๋ฉด ์ข‹๊ฒ ์Šต๋‹ˆ๋‹ค.

์•ˆ๋…•! ํด๋กœ๋ฐ”ํŒŒํŠธ๋ผ

ํŒ€ ๋ฌธํ™”

๐Ÿค Ground Rule

ํ˜‘์—… ๋ฐฉ์‹

๐Ÿ”’ Convention
๐ŸŒณ Git Branch ์ „๋žต

๊ฐœ๋ฐœ ๋ฌธ์„œ

๐Ÿ› ๏ธ AGT - Automatic Git & Github Tool
๐Ÿ“Š WebRTC Mesh โ€ ํŠธ๋ž˜ํ”ฝ ๊ณ„์‚ฐ
๐ŸŽข WebRTC Mesh - ํ—˜๋‚œํ•œ ์—ฌ์ •
๐Ÿ’ฌ WebRTC๋ฅผ ์•Œ์•„๋ณด์ž
๐Ÿ“ฎ SSE(Server Sent Events)
๐Ÿ“– SSE Pagination
โณ Socket ํ†ต์‹ ์—์„œ ๋น„๋™๊ธฐ ์ž‘์—… ์ˆœ์„œ ๋ณด์žฅ ๋ฐฉ๋ฒ•
๐Ÿ“ก Redis pub/sub๋ฅผ ํ™œ์šฉํ•œ SSE ์ ์šฉ๊ธฐ
๐Ÿ—๏ธ Naver Cloud Platform์„ ํ™œ์šฉํ•œ ๋ฐฐํฌ ์ „๋žต
โš”๏ธ๐Ÿš€ ๋ถ€ํ•˜ ํ…Œ์ŠคํŠธ: ๋‹จ์ผ ์ธ์Šคํ„ด์Šค VS NKS
๐Ÿšดโ€โ™€๏ธ Redis๋กœ ๊ฒŒ์ž„๋ฐฉ ๊ด€๋ฆฌ ์ตœ์ ํ™”: ํšจ์œจ์ ์ธ ๋ฐ์ดํ„ฐ ์ฒ˜๋ฆฌ์™€ ์„ฑ๋Šฅ ๊ฐœ์„ 

ํšŒ์˜๋ก

๐Ÿ“† ํšŒ์˜๋ก ์บ˜๋ฆฐ๋”
๐Ÿ–ค ๋ฐ์ผ๋ฆฌ ์Šคํฌ๋Ÿผ ํ…œํ”Œ๋ฆฟ
๐Ÿ–ค ํšŒ๊ณ  ํ…œํ”Œ๋ฆฟ

๋ฉ˜ํ† ๋ง

0๏ธโƒฃ 0์ฃผ์ฐจ ๋ฉ˜ํ† ๋ง ์ผ์ง€
1๏ธโƒฃ 1์ฃผ์ฐจ ๋ฉ˜ํ† ๋ง ์ผ์ง€
2๏ธโƒฃ 2์ฃผ์ฐจ ๋ฉ˜ํ† ๋ง ์ผ์ง€
3๏ธโƒฃ 3์ฃผ์ฐจ ๋ฉ˜ํ† ๋ง ์ผ์ง€
4๏ธโƒฃ 4์ฃผ์ฐจ ๋ฉ˜ํ† ๋ง ์ผ์ง€

๋ฐœํ‘œ

0๏ธโƒฃ 0์ฃผ์ฐจ ๋ฐœํ‘œ
1๏ธโƒฃ 1์ฃผ์ฐจ ๋ฐœํ‘œ
2๏ธโƒฃ 2์ฃผ์ฐจ ๋ฐœํ‘œ
3๏ธโƒฃ 3์ฃผ์ฐจ ๋ฐœํ‘œ
4๏ธโƒฃ 4์ฃผ์ฐจ ๋ฐœํ‘œ
5๏ธโƒฃ ์ตœ์ข… ๋ฐœํ‘œ

Clone this wiki locally