HN2new | past | comments | ask | show | jobs | submitlogin
Show HN: gRPC over WebRTC (github.com/jsmouret)
102 points by jsmouret on June 21, 2020 | hide | past | favorite | 12 comments


The idea started from a long running discussion about adding support for bidirectional streaming to grpc-web ( https://github.com/grpc/grpc-web/issues/24 )

While Improbable already has a solution using Websocket, WebRTC can bring UDP, peer to peer and NAT traversal for free, which can be really cool.

I hope this proof of concept inspires a proper production implementation :)


The whole streaming gRPC for browsers story is indeed a rather interesting (and sad) one. Around 4 years ago this seem to just have been blocked on the browsers missing some APIs for streaming HTTP bodies instead of waiting for the whole response to complete.

The situation there still doesn't have changed if I read that thread correctly - but instead of adding those APIs there is now talk about using completely different technologies and yet another set of non-available APIs? That doesn't make a lot of sense to me.

And while WebRTC (or using a not-yet-specified protocol on top of QUIC) might be rather cool POCs, those throw a lot of complexity at a workaround for a problem which seems to have a far easier solution (get the required APIs implemented).


Grief, bi-directional support to the browser would be awesome. (Even better would be not needing a proxy, but that isn't going to happen without official adoption.)


Very cool to see more people experimenting in this area. I've similarly implemented GraphQL over WebRTC for https://tegapp.io/ and had great initial success 3D printing over data channels.

One thing I didn't immediately see in this code (excuse me if I just missed it - this was a quick read through) is a chunking mechanism to limit data channel messages to their 2^16 byte maximum. If your looking for a drop in solution saltryrtc has something you might be able to use: https://github.com/saltyrtc/chunked-dc-js

GRPC and similarly GraphQL over WebRTC gets you a long ways towards controlling local servers over the net however the problem of how to handle signalling in a way that works both online and offline is still a big hurdle. Personally, I'm pretty excited to see where these WebRTC servers can go with DAT and IPFS decentralized signalling solutions.

Thanks again for sharing. Great project!


You're right, there is no chunking... yet :) Thanks for the links


Fantastic work jsmouret!

I am honestly no as familiar with gRPC as I should be (life is all about WebRTC/P2P Media for me). I am really excited about the NAT traversal/P2P opportunities this opens up.

It seems super powerful that you could have two services with different regions/DC/providers talk to each other. With neither even having public IPs! You don't have to worry about Load Balancers and really could reduce complexity/security concerns.


According to the GRPC website, the technology is completely tied to protocol buffers? Seems like an odd and specific dependency to have for something like that: https://grpc.io/


Not really. Take a look here: https://grpc.io/blog/grpc-with-json/


GRPC does not require you use a specific serialization format. However in practice just about everyone uses protobufs simply because it is well integrated for all languages.


I was wondering about this myself. Someone mentioned grpc is not for video, so kinda gave up.


flatend has bi-directional rpc enabled: https://github.com/lithdew/flatend

Can stream large files too!


Wow, this is great. Have been considering something similar only this week.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: