https://github.com/sheraff/webrtc-demo
https://github.com/sheraff/webrtc-demo
Last synced: 21 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/sheraff/webrtc-demo
- Owner: Sheraff
- Created: 2020-08-14T00:52:31.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-14T11:24:10.000Z (almost 6 years ago)
- Last Synced: 2025-01-26T19:51:53.153Z (over 1 year ago)
- Language: JavaScript
- Homepage: https://webrtc.florianpellet.com
- Size: 11.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# webRTC-demo
1. Serve files w/ a php server. For local use:
``` bash
php -S localhost:5000
```
2. Open a first client
``` javascript
const rtcClient1 = new RTCPeer('some-id-1')
rtcClient1.startHosting('some-id-2')
```
3. open a second client
``` javascript
const rtcClient2 = new RTCPeer('some-id-2')
rtcClient2.joinHost('some-id-1')
```
The order of operations shouldn't matter.
----
You can also do everything in the same client but it's less fun
``` javascript
const rtcClient1 = new RTCPeer('some-id-1')
const rtcClient2 = new RTCPeer('some-id-2')
rtcClient1.startHosting('some-id-2')
rtcClient2.joinHost('some-id-1')
```