Seeing this error in firefox when calling peer.signal(offer). This is logged from from peer.on('error', (err) => {})
offer looks like:
{
"type": "answer",
"sdp": "v=0\no=- 2361903802410725008 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=msid-semantic: WMS\r\nm=application 0 UDP/DTLS/SCTP 5000\r\nc=IN IP4 0.0.0.0\r\na=mid:0\r\na=sctpmap:5000 webrtc-datachannel 1024\r\n"
}
It looks like m=application 0 UDP/DTLS/SCTP 5000. The \r\n carriage returns are concerning. I tried replacing them offer.sdp = offer.sdp.replace('\r\n', '\n'); with no luck.
This same handshake setup works in Chrome the crome answer looks like:
{
"type":"answer",
"sdp":"v=0\r\no=- 6148643454612116579 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE data\r\na=msid-semantic: WMS\r\nm=application 9 DTLS/SCTP 5000\r\nc=IN IP4 0.0.0.0\r\nb=AS:30\r\na=ice-ufrag:FC2g\r\na=ice-pwd:FAYzNn2P/NKl3nPazdVjK5Vj\r\na=fingerprint:sha-256 C6:33:30:F2:11:1D:FE:31:4D:F5:70:F3:6A:84:1B:98:36:EB:A3:D0:C1:DB:88:EC:24:52:EF:D1:1D:A0:F2:A7\r\na=setup:active\r\na=mid:data\r\na=sctpmap:5000 webrtc-datachannel 1024\r\n"
}
m here looks like m=application 9 DTLS/SCTP 5000
Your offer is an not an offer but SDP answer (it says in the type field). It's definitely not complete (missing a fingerprint for one). Can you double check that there isn't a problem with your signalling setup?
You shouldn't remove carriage returns, they're correct.
Are you adding streams/tracks or is this datachannel only?
Thanks for the quick reply @t-mullen. This is data channel only.
So my signaling setup works consistently in Chrome and I'm treating this as a firefox browser issue but it might be something else. My code above citing the offer var is poorly named and should be considered signalPayload its the value collected from peer.on('signal') that is transmitted across the signaling server connection
This setup is a centralized client server model where all Browser peers only have to 1 connection to the same Node.js server peer. Below is a comparison of the Chrome/Firefox offer/answer payloads
{
type: "offer",
sdp:
"v=0
o=- 5121147169778109884 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE data
a=msid-semantic: WMS
m=application 9 DTLS/SCTP 5000
c=IN IP4 0.0.0.0
a=ice-ufrag:CmIA
a=ice-pwd:jHCWR4JJquU/r8KXtP0cQ9YN
a=ice-options:trickle
a=fingerprint:sha-256 0C:AC:DB:40:8E:AD:58:D8:09:3B:66:94:63:1B:00:D0:09:BD:F3:72:BF:29:66:53:94:9B:67:22:A9:27:A0:35
a=setup:actpass
a=mid:data
a=sctpmap:5000 webrtc-datachannel 1024
"
}
{
type: "offer",
sdp:
"v=0
o=mozilla...THIS_IS_SDPARTA-64.0.2 6450781105440687594 0 IN IP4 0.0.0.0
s=-
t=0 0
a=sendrecv
a=fingerprint:sha-256 54:5D:CF:E6:B6:B5:9B:60:C3:AB:F3:EC:5A:62:18:5E:13:F2:1A:23:86:03:BA:9D:D0:EA:67:7B:1C:5C:0A:2A\r\na=group:BUNDLE 0\r\na=ice-options:trickle
a=msid-semantic:WMS *
m=application 9 UDP/DTLS/SCTP webrtc-datachannel
c=IN IP4 0.0.0.0
a=sendrecv
a=ice-pwd:c2217ee835bac1bdc0a765ebf1b5de2c
a=ice-ufrag:b0ceda3e
a=mid:0
a=setup:actpass
a=sctp-port:5000
a=max-message-size:1073741823"
}
"v=0
o=- 4547471447226747141 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE data
a=msid-semantic: WMS
m=application 62951 DTLS/SCTP 5000
c=IN IP4 192.168.1.159
b=AS:30
a=candidate:105744546 1 udp 2122260223 192.168.1.159 62951 typ host generation 0 network-id 1 network-cost 50
a=ice-ufrag:taPA
a=ice-pwd:Q/W3D4wgrRqMrfVT51yO3i5T
a=fingerprint:sha-256 2A:3C:A3:64:92:7D:32:F5:AB:5F:69:1F:C1:76:82:4C:97:A3:FE:CA:70:C5:E3:FA:FC:C0:11:FC:E3:DB:D5:1C
a=setup:active
a=mid:data
a=sctpmap:5000 webrtc-datachannel 1024"
"v=0
o=- 1575807233894551963 2 IN IP4 127.0.0.1
s=-
t=0 0
a=msid-semantic: WMS
m=application 0 UDP/DTLS/SCTP 5000
c=IN IP4 0.0.0.0
a=mid:0
a=sctpmap:5000 webrtc-datachannel 1024"
The firefox answer is missing many of the fields the chrome answer has. The fingerprint is present in the firefox offer but missing in the answer.
You're connecting Firefox-to-Firefox correct? What do your peer options look like?
You're connecting Firefox-to-Firefox correct? What do your peer options look like?
No. Firefox-to-Node.js
sounds like there is a breaking change between Firefox SDP parsing and the node.js wrtc module output. Going to close because don't think its directly related to simple-peer.