Can I use WebRTC to open a UDP connection?

前端 未结 2 2020
醉梦人生
醉梦人生 2020-12-14 22:45

We need send data to our users\' devices using the TFTP protocol, which is a simple FTP-like protocol that works over UDP.

Since we can\'t open a UDP socket using ja

相关标签:
2条回答
  • 2020-12-14 23:13

    No, you cannot send raw UDP data using WebRTC like that.

    The ViENetwork lib where you can find the SendUDPPacket method is used inside Chrome to handle packet transmissions, Windows QoS support and other network settings, but you don't have direct access to it.

    One of the main features of WebRTC is the Data Channel that will bring the possibility to establish a peer-to-peer connection between two browsers, to allow raw data to be exchanged. This is still under construction in Chrome and Firefox as you can see here.

    This can be what you are searching for, as you can establish a connection to send raw data and you will only have to worry in find a way to establish this connections to your other endpoint, if that's what you want.

    0 讨论(0)
  • 2020-12-14 23:14

    No. There are too many security issues allowing WebRTC to send to a random address/port - we have to make sure it doesn't work as a DDOS platform, so we require the target to implement ICE as an implicit permission to send data, and we also don't allow sending arbitrary data, just SRTP mediastreams and data in DataChannels (over SCTP over DTLS over UDP+ICE).

    0 讨论(0)
提交回复
热议问题