Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/jsmouret/grpc-over-webrtc

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/jsmouret/grpc-over-webrtc

  • v0.0.0-20220908002126-f26d8e2e3b6d
  • Source
  • Go
  • Socket score

Version published
Created
Source

gRPC over WebRTC

Just a proof of concept, please be kind.

How to

  1. Start all the things

    • Client, create-react-app + grpc-web signaling + webrtc extensions

        cd client
        yarn
        yarn start
      
    • Client v2, same but using Improbable version with client and bidi-streaming

        cd client-improbable
        yarn
        yarn start
      
    • Server, grpc server + grpc-web signaling + pion/webrtc

        cd server
        go run .
      
  2. Click on buttons in your browser

  3. 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

FAQs

Package last updated on 08 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc