Home > Back-end >  Using emailing for signaling in webRTC
Using emailing for signaling in webRTC

Time:12-21

In this question, Felix Hagspiel's answers says:

"This means that you are free to choose how you exchange network information. I.e. you could use websockets, HTTP and even Email, but that would be a bit of a struggle"

I have some questions about this. First, if one were to use emailing for signaling, would this avoid the need for a web server to establish the connection between the two browser clients? If not, what would the web server be needed for?

Moreover, if one were to use email for signaling, how many emails would need to be sent between the clients before the connection was established? For example, say there are two clients, Alice and Bob who want to create a connection. Say the first email is an email from Alice to Bob, then the second is an email from Bob to Alice, and so on. How many email would there be needed in total before the real time communication could be established?

Finally, where might I find documentation or other resources explaining how I would set up webRTC with signaling via email rather than using a web server?

CodePudding user response:

Yes, you can initiate a webrtc connection without a web server, using just emails (by copying/pasting SDP messages from the letters to your web client).

A web server might still come in handy to serve static files as you need some kind of frontend for your clients. But if your clients have static files locally then yes, you might do without a web server at all.

You can use the code example from this answer. Generate offer in one browser, then copy and send it via email. In another browser paste the offer from email, create answer and deliver it back to the first browser. The only difference is that you use email instead of clipboard.

how many emails would need to be sent between the clients before the connection was established?

Establishing a connection can be done with a single letter from Alice to Bob and one from Bob to Alice. By default webrtc might use more messages during signalling when using trickle ice feature. To make sure one letter is enough you should wait for the candidates to gather before sending the offer/answer. See this answer.

  • Related