Closed junha1 closed 11 months ago
I have two important question
@junha1
RTCDataChannel
instance that represents a network channel which can be used for bidirectional peer-to-peer transfers after the ICE procedure. Therefore, it requires both peers to be able to finish NAT Traversal. If a peer isn't able to connect with other through a STUN server, I guess it's impossible to connect them using WebRTC. For this case, they can communicate through a common server-client model used in Simperby now after detecting a failure of using WebRTC.RTCDataChannel
instance. I'm not sure we can extract a raw socket from this and extracting it is a right way. This is a quite high-level instance as it deals with data communication over layered protocols (ref. https://hpbn.co/assets/diagrams/f91164cbbb944d8986c90a1e93afcd82.svg).
I think it's better to keep the current communication way and provide a new WebRTC option. Because I'm not sure the WebRTC can be completely compatible with and perfectly replace the current interface of Simperby.
A SDP message used in webrtc-rs (https://github.com/webrtc-rs/webrtc) includes media settings and ICE candidates. We won't use this for media communication, so we may use hard-coded media settings. However, ICE candidates are dynamic, because it depends on network situation. Therefore, I guess we have to figure out how to keep this valid for a long time using keepalives and coordinating timeouts in ICE. If it's not possible, we may have to introduce a signalling server for the exchange of the latest SDPs.
ref. https://datatracker.ietf.org/doc/html/rfc8445#page-54 https://github.com/webrtc-rs/webrtc/blob/3f1c67e1fc0004415897635ee47bec0b7962563f/webrtc/src/api/setting_engine/mod.rs#L107