jsmouret/grpc-over-webrtc
Tentang
gRPC melalui WebRTC
Proyek lainnyaPertumbuhan bintang terukur
- dalam 24 jam
- 0
- dalam 7 hari
- 0
- dalam 15 hari
- 0
- dalam 1 bulan
- Mengumpulkan riwayat
Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.
README.md
AsligRPC over WebRTC
Just a proof of concept, please be kind.
How to
Start all the things
Client, create-react-app + grpc-web signaling + webrtc extensions
cd client yarn yarn startClient v2, same but using Improbable version with client and bidi-streaming
cd client-improbable yarn yarn startServer, grpc server + grpc-web signaling + pion/webrtc
cd server go run .
Click on buttons in your browser
Profit!
Notes
Regular gRPC client/server are implemented in client/src/echo.tsx and server/echo.go. They should look like business as usual.
To simplify establishing the connection, this uses a simple grpc-web api defined by signaling.proto. It expects to run on localhost so there is no fancy ICE candidate exchange, that would be out of scope.
For the grpc-web client, the magic happens in client/src/grtc/adapter.ts which introduces a WebRtcClientBase to replace GrpcWebClientBase.
For the improbable client, instead of using a new transport which manipulates chunks, client-improbable/src/grpc/client.ts dispatches
between the original GrpcClient and WebRtcClient. The other files in client-improbable/src/grpc are just linking to that new client function.
References
- Pion WebRTC, data channels example
- gRPC Web, gateway echo example
- Improbable gRPC Web
- Where it started
Jelajahi proyek terkait
Memuat…