Alexmedkex
Alexmedkex

Reputation: 457

Establishing a WebRTC connection without a server, one-way

I would like to send messages between two peers using WebRTC without a signaling server. I'm using QR codes to send over the connection descriptions, and I found an example implementing exactly this:

https://github.com/TomasHubelbauer/webrtc-qr-signaling-channel

However, it requires scanning the QR code both ways. I'm wondering if it's possible to only have to scan a QR code from the phone, but still establish a connection?

Conceptually, I'm thinking like this:

  1. ClientA shows QR code, essentially saying "here's how to connect to me."
  2. ClientB scans it, and now knows how to find ClientA.
  3. ClientB sends "here's how to connect to me" to clientA.
  4. They now both know how to find and talk to eachother.

However, this doesn't seem possible when looking through the WebRTC documentation. If this isn't possible to do - then why?

Upvotes: 1

Views: 1412

Answers (1)

jch
jch

Reputation: 5651

I strongly doubt it is possible.

During the offer/answer exchange, each of the peers generates a self-signed (D)TLS certificate and includes its cryptgraphic hash ("fingerprint") in the SDP. Without the answer's SDP, the offering peer would be unable to authentify the answering one.

You might be able to achieve the same user experience, however, by implementing a signalling server on one of the peers. The QR code would contain the URL of the signalling server together with authentication data, and once connected the two peers could perform a traditional offer/answer SDP, and even trickle ICE candidates.

Upvotes: 1

Related Questions