Skip to content
프로젝트

node-webrtc/node-webrtc-examples

GitHub에서 보기

소개

node-webrtc를 사용한 MediaStream 및 RTCDataChannel 예제

학습 및 교육

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
-2
in 15 days
-2
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

node-webrtc-examples

This project presents a few example applications using node-webrtc.

Usage

Install the project's dependencies and run the tests before starting the application server:

npm install
npm test
npm start

Then, navigate to http://localhost:3000.

Architecture

Each example application under examples/ has a Client and Server component. RTCPeerConnection negotiation is supported via a REST API (described below), and is abstracted away from each example application. Code for RTCPeerConnection negotiation lives under lib/.

RTCPeerConnection Negotiation

RTCPeerConnections are negotiated via REST API. The Server always offers (with host candidates) and the Client always answers. In order to negotiate a new RTCPeerConnection, the Client first POSTs to /connections. The Server responds with an RTCPeerConnection ID and SDP offer. Finally, the Client POSTs an SDP answer to the RTCPeerConnection's URL.

Client                                               Server
  |                                                     |
  |  POST /connections                                  |
  |                                                     |
  |---------------------------------------------------->|
  |                                                     |
  |                                             200 OK  |
  |  { "id": "$ID", "localDescription": "$SDP_OFFER" }  |
  |                                                     |
  |<----------------------------------------------------|
  |                                                     |
  |  POST /connections/$ID/remote-description           |
  |  $SDP_ANSWER                                        |
  |                                                     |
  |---------------------------------------------------->|
  |                                                     |
  |                                             200 OK  |
  |                                                     |
  |<----------------------------------------------------|

RTCPeerConnection Teardown

RTCPeerConnections can be proactively torn down by sending a DELETE to the RTCPeerConnection's URL; otherwise, ICE disconnection or failure, if unresolved within the timeToReconnect window, will also trigger teardown. The default timeToReconnect value is 10 s.

Client                                               Server
  |                                                     |
  |  DELETE /connections/$ID                            |
  |                                                     |
  |---------------------------------------------------->|
  |                                                     |
  |                                             200 OK  |
  |                                                     |
  |<----------------------------------------------------|

관련 프로젝트 살펴보기

불러오는 중…