Open darkuranium opened 7 months ago
I got it working!
Above fixes lead me to the ultimate one, which is to add STUN_ATTR_TYPE_XOR_MAPPED_ADDRESS
to STUN mappings. (I've implemented this in agent.c
)
It's still not a full solution — it makes the prflx
candidate work, but not host
candidates. That might be a feature of Firefox though, as I have this vague memory that Firefox rejects all such candidates on LAN for privacy and/or security reasons. I'm not 100%, I'll have to investigate this further. But I do have a working solution now!
I strongly suspect the two issues in the title are related, hence grouping them to the same ticket.
I've run into it during the course of implementing #53, and after some investigation, I believe I may have found a clue, which is related to another issue.
First, the other issue; (which lead to the clue; I'm putting it here because I believe it's part of the solution, even though it's not the entire one) The following line in
agent.c
is a no-op:Since
strlen(description)
is the length of the string,foo[strlen(foo)]
will always be\0
. I assume you meantstrlen(description) - 1
.However, there is also a problem in
ice_candidate_to_description(...)
, namely:... I'm pretty sure that should have been a
\r\n
, which would make the other linestrlen(description) - 2
.In other words: (diff minimized for brevity)
Fixing the above issue reveals an error message in Firefox (as opposed to it simply dropping the connection after a few seconds):
... comparing with other (working) WebRTC implementations, it looks the
c=...
line must immediately follow them=...
line, whereas libpeer intermixes them:libpeer (non-working)
https://test.antmedia.io:5443/LiveApp/webrtc-test-tool.html (working)
I'll continue the investigation, but perhaps this'll be useful to someone in the meantime.