WebRTC Data Channel server to clients UDP communication. Is it currently possible?

前端 未结 2 1786
日久生厌
日久生厌 2020-12-29 15:04

Is it possible to use WebRTC Data Channels on Node.js in a way that mimics the functionality of WebSockets except using UDP?

In essence I want to have a server runni

2条回答
  •  旧巷少年郎
    2020-12-29 15:27

    We have implemented the exact same thing: a server/client way of using WebRTC. Besides we also implemented data port multiplexing, so that server would only need to expose one data port for all rtcdata channels.

    A quick summary of how it is achieved:

    • We implemented in nodejs, using wrtc library. But the same principal could be applied to other implementations.
    • The server exposes a control port, so that the client will exchange SDPs with the server for establishing their data channel.
    • To support data port multiplexing, At the server, we modify both peer's SDK, so that
      1. Client will always connect to the same server ip:data_port
      2. We implement a UDP data proxy inside the server, so that it can be the bridge between the server webrtc engine and the client.

    The code is at: https://github.com/noia-network/webrtc-direct

提交回复
热议问题