How can we improve the Microsoft Edge developer experience?

Support WebRTC Datachannels in Workers

I would like to propose that we support WebRTC Data Channel in Workers
(`WebWorker`, `ServiceWorker`, etc.)

WebRTC DataChannel is basically a drop-in replacement for `WebSocket`,
except it's peer-to-peer. For all the same reasons that `WebSocket`
was added to the `Worker` spec, we should add WebRTC DataChannel.

Here are some possible use cases:

- DataChannel in a `ServiceWorker` would support the use case of "peer
assisted delivery" a la [PeerCDN](https://www.peercdn.com/faq.html),
CDN/P2P CDN video streaming delivery, file transfer, etc.

- DataChannel in a `WebWorker` would support offloading CPU intensive
data transfer and subsequent processing to another thread.

- DataChannel in a `SharedWorker` would let one construct and reuse a
DHT (a decentralized/distributed lookup service similar to a hash
table) across tabs. Useful for routing to nodes in decentralized
applications.

Websockets are already available in Workers, so there likely aren't
any new security/privacy issues, just potential for exciting new data
channel use cases!

240 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Feross Aboukhadijeh shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    2 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...
      • Lennart Grahl commented  ·   ·  Flag as inappropriate

        Sorry for digging this up. But may I add the comment that data channels are mandatory in WebRTC. Thank you.

      • Feross Aboukhadijeh commented  ·   ·  Flag as inappropriate

        Data channels *in workers* are under review? Or data channels, period?

        The status page shows that the WebRTC v1.0 API is "In Development", but you realize that Data Channels are part of the WebRTC 1.0 API, right?

      Feedback and Knowledge Base