https://github.com/topheman/webrtc-remote-control
Thin abstraction layer above peerjs that will let you be more productive at making WebRTC data channels based apps.
https://github.com/topheman/webrtc-remote-control
peerjs react rtcdatachannel vue webrtc
Last synced: about 1 year ago
JSON representation
Thin abstraction layer above peerjs that will let you be more productive at making WebRTC data channels based apps.
- Host: GitHub
- URL: https://github.com/topheman/webrtc-remote-control
- Owner: topheman
- License: mit
- Created: 2022-01-17T13:44:08.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-08-16T11:02:52.000Z (almost 4 years ago)
- Last Synced: 2025-04-16T04:24:12.901Z (about 1 year ago)
- Topics: peerjs, react, rtcdatachannel, vue, webrtc
- Language: JavaScript
- Homepage: https://webrtc-remote-control.vercel.app
- Size: 1.85 MB
- Stars: 13
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# webrtc-remote-control
[](https://github.com/topheman/webrtc-remote-control/actions/workflows/ci.yml)
[](https://www.conventionalcommits.org)
[](http://webrtc-remote-control.vercel.app/)
Implementations
| Package | Version |
| ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| [@webrtc-remote-control/core](./packages/core#readme) | [](https://www.npmjs.com/package/@webrtc-remote-control/core) |
| [@webrtc-remote-control/react](./packages/react#readme) | [](https://www.npmjs.com/package/@webrtc-remote-control/react) |
| [@webrtc-remote-control/vue](./packages/vue#readme) | [](https://www.npmjs.com/package/@webrtc-remote-control/vue) |
- [Demo](./demo#readme)
- [CONTRIBUTING](CONTRIBUTING.md)
## The problem
[PeerJS](https://peerjs.com) is a great layer of abstraction above WebRTC with a simple API, though, you still need to:
- track your connections
- handle reconnects of peers when your page reloads
You don't want to think about this kind of networking problems, you want to focus on your app logic.
**webrtc-remote-control** handles all of that.
## The use case
**webrtc-remote-control** was made to handle star topology network:

You have:
- One "master" page connected to
- Multiple "remote" pages
What you can do (through data-channel):
- From "master" page, you can send data to any or all "remote" pages
- From one "remote" page, you can send data to the master page
When "master" page drops connection (the page closes or reloads), the "remote" pages are notified (and remote automatically reconnect when master retrieves connection).
When a "remote" page drops connection (the page closes or reloads), the "master" page gets notified (and the remote reconnects to master as soon as it reloads).
## Genesis
A few years ago I made [topheman/webrtc-experiments](https://github.com/topheman/webrtc-experiments), as a proof of concept for WebRTC data-channels relying on PeerJS.