-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pion-http-proxy (p2p REST/JSON/GRPC over WebRTC) #14
Comments
Interesting post. I am in the process to evaluate options for an industrial project. Use case goes along this line: Embedded edge device sends data via WebRTC and multiple channels to one or a small number of destinations. It may receive back data via data channel. Not all peers are in the same local network. STUN and TURN will be part of the setup. To initiate the communication a simple central signalling server, which acts as registration and "matchmaker" providing the SDP offer-answer task. PeerJS sounds good to me, with a few add-ons. Was the topic going forward in the meantime? Any reactions so far? HTTP over WebRTC lead me to the question if it would make sense to MQTT over WebRTC. Maybe i had a bad moment .. |
This may be relevant for your project: |
any news? |
Summary
There are a lot of use cases for easy p2p communication between browser and edge devices. Most stemming from giving users ultimate privacy and control over their own data. Breaking free of big brother cloud providers that offer convenient collection and "care" of user data.
There are many http client and server libraries, a vast body of knowledge and established best practices (e.g REST, JSON, GRPC) over HTTP(1,2,websockets). Implementations are available for most OS platforms and languages. However there is currently no well established project that solves the combination of the two issues: easy p2p over http APIs.
Developers looking to build web browser supported p2p APIs have to dive deep and master the complicated, unfamiliar, low level WebRTC APIs that are also hard to debug and test.
Motivation
A number of projects in the awesome-pion section approach this problem from slightly different perspectives.
https://github.com/jsmouret/grpc-over-webrtc
https://github.com/duality-solutions/web-bridge
https://github.com/rtctunnel/rtctunnel
https://github.com/keroserene/snowflake
https://github.com/decentraland/webrtc-broker
https://github.com/ailabstw/webrtc-socket-proxy
https://github.com/muka/peerjs-go
Maybe it's worth having a community conversation on joining forces for a minimum viable foundation for http over webrtc that enables other higher level solutions to be built on top.
There are two big sub-topics to cover:
Signaling
It seems like there is a potential to have a highly available community supported global p2p signaling network of servers.
For example for Ambianic.ai, we rely on the incredibly simple and powerful PeerJS Server that provides an ephemeral, privacy preserving, easy to scale, easy to maintain and extend foundation. We added a peer-room plugin for LAN peer discovery, which solves our use case allowing browser apps to discover and connect to other browser apps or IoT devices on the same WiFi/LAN. The idea and implementation was inspired ShareDrop. More on our particular use case and solution here.
The PeerJS Server deployment has had no unscheduled downtime in 2020 and was last patched over 6 months ago. It's been that reliable, useful and stable.
There are well known community networks for torrents , Tor, Matrix and blockchain support. It only makes sense to have one that has the minimal viable protocol for p2p connectivity that makes no assumptions about how peers will exchange messages once they connect. Nor should it make assumptions about what type of messages will be exchanged.
There is also a growing set of independently maintained public STUN servers, which is the other critical missing piece for p2p comms.
Here is a strawman for a minimal signaling server functionality:
That's essentially what PeerJS Server does today. It has a plug-in architecture that allows higher level signaling protocols to be built on top. Similarly to STUN servers, PeerJS Servers are standalone and can be deployed for a private p2p network or shared with the community for public access.
Can we designate PeerJS Server as the minimum signaling server reference implementation or we need to design something different?
HTTP over WebRTC Payload Format
This problem can be split into stages:
An initial primitive implementation for stage 1 on the browser side is available here. A corresponding http-over-webrtc-proxy implementation is available here (in Python).
Describe alternatives you've considered
There a few other OSS projects that have overlapping goals, but broader scope.
libp2p (an IPFS sub-project) has a webrtc subgroup with http over webrtc layer.
The Matrix team is experimenting with p2p comms over http with browser support:
The text was updated successfully, but these errors were encountered: