singularity


const lc = new RTCPeerConnection()
undefined

const dc = lc.createDataChannel("channel")
undefined

dc.onmessage = e  => console.log("msg received", e.data);
e  => console.log("msg received", e.data)

dc.onopen = e => console.log("connection open");
e => console.log("connection open")

lc.onicecandidate = e => console.log("New Ice Candidate! reprinting SDP", JSON.stringify(lc.localDescription));
e => console.log("New Ice Candidate! reprinting SDP", JSON.stringify(lc.localDescription))
lc.createOffer().then(offer => lc.setLocalDescription(offer)).then(a=>console.log("set successfully"))
Promise {<pending>}
VM1018:1 set successfully
VM771:1 New Ice Candidate! reprinting SDP {"type":"offer","sdp":"v=0\r\no=- 5565229606022261744 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0\r\na=extmap-allow-mixed\r\na=msid-semantic: WMS\r\nm=application 53529 UDP/DTLS/SCTP webrtc-datachannel\r\nc=IN IP4 172.30.192.1\r\na=candidate:2697046791 1 udp 2122260223 172.30.192.1 53529 typ host generation 0 network-id 1\r\na=ice-ufrag:NSiw\r\na=ice-pwd:/cXkYeL4kTBiHxJGjmekThDi\r\na=ice-options:trickle\r\na=fingerprint:sha-256 01:08:4A:81:35:93:A2:5D:8E:04:A3:F3:A3:8E:72:AC:59:63:D2:47:60:FB:D8:0A:DA:E6:C3:A4:07:E7:1C:CD\r\na=setup:actpass\r\na=mid:0\r\na=sctp-port:5000\r\na=max-message-size:262144\r\n"}
VM771:1 New Ice Candidate! reprinting SDP {"type":"offer","sdp":"v=0\r\no=- 5565229606022261744 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0\r\na=extmap-allow-mixed\r\na=msid-semantic: WMS\r\nm=application 53529 UDP/DTLS/SCTP webrtc-datachannel\r\nc=IN IP4 172.30.192.1\r\na=candidate:2697046791 1 udp 2122260223 172.30.192.1 53529 typ host generation 0 network-id 1\r\na=candidate:2943896220 1 udp 2122063615 192.168.29.242 53530 typ host generation 0 network-id 2 network-cost 10\r\na=ice-ufrag:NSiw\r\na=ice-pwd:/cXkYeL4kTBiHxJGjmekThDi\r\na=ice-options:trickle\r\na=fingerprint:sha-256 01:08:4A:81:35:93:A2:5D:8E:04:A3:F3:A3:8E:72:AC:59:63:D2:47:60:FB:D8:0A:DA:E6:C3:A4:07:E7:1C:CD\r\na=setup:actpass\r\na=mid:0\r\na=sctp-port:5000\r\na=max-message-size:262144\r\n"}
VM771:1 New Ice Candidate! reprinting SDP {"type":"offer","sdp":"v=0\r\no=- 5565229606022261744 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0\r\na=extmap-allow-mixed\r\na=msid-semantic: WMS\r\nm=application 53529 UDP/DTLS/SCTP webrtc-datachannel\r\nc=IN IP4 172.30.192.1\r\na=candidate:2697046791 1 udp 2122260223 172.30.192.1 53529 typ host generation 0 network-id 1\r\na=candidate:2943896220 1 udp 2122063615 192.168.29.242 53530 typ host generation 0 network-id 2 network-cost 10\r\na=candidate:1048604279 1 udp 2122197247 2405:201:5012:510e:35c4:49b8:a9b2:58ab 53531 typ host generation 0 network-id 3 network-cost 10\r\na=ice-ufrag:NSiw\r\na=ice-pwd:/cXkYeL4kTBiHxJGjmekThDi\r\na=ice-options:trickle\r\na=fingerprint:sha-256 01:08:4A:81:35:93:A2:5D:8E:04:A3:F3:A3:8E:72:AC:59:63:D2:47:60:FB:D8:0A:DA:E6:C3:A4:07:E7:1C:CD\r\na=setup:actpass\r\na=mid:0\r\na=sctp-port:5000\r\na=max-message-size:262144\r\n"}
VM771:1 New Ice Candidate! reprinting SDP {"type":"offer","sdp":"v=0\r\no=- 5565229606022261744 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0\r\na=extmap-allow-mixed\r\na=msid-semantic: WMS\r\nm=application 53529 UDP/DTLS/SCTP webrtc-datachannel\r\nc=IN IP4 172.30.192.1\r\na=candidate:2697046791 1 udp 2122260223 172.30.192.1 53529 typ host generation 0 network-id 1\r\na=candidate:2943896220 1 udp 2122063615 192.168.29.242 53530 typ host generation 0 network-id 2 network-cost 10\r\na=candidate:1048604279 1 udp 2122197247 2405:201:5012:510e:35c4:49b8:a9b2:58ab 53531 typ host generation 0 network-id 3 network-cost 10\r\na=candidate:2836137395 1 udp 2122131711 2405:201:5012:510e:77cc:13c7:25e6:bfb1 53532 typ host generation 0 network-id 4 network-cost 10\r\na=ice-ufrag:NSiw\r\na=ice-pwd:/cXkYeL4kTBiHxJGjmekThDi\r\na=ice-options:trickle\r\na=fingerprint:sha-256 01:08:4A:81:35:93:A2:5D:8E:04:A3:F3:A3:8E:72:AC:59:63:D2:47:60:FB:D8:0A:DA:E6:C3:A4:07:E7:1C:CD\r\na=setup:actpass\r\na=mid:0\r\na=sctp-port:5000\r\na=max-message-size:262144\r\n"}
VM771:1 New Ice Candidate! reprinting SDP {"type":"offer","sdp":"v=0\r\no=- 5565229606022261744 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0\r\na=extmap-allow-mixed\r\na=msid-semantic: WMS\r\nm=application 53529 UDP/DTLS/SCTP webrtc-datachannel\r\nc=IN IP4 172.30.192.1\r\na=candidate:2697046791 1 udp 2122260223 172.30.192.1 53529 typ host generation 0 network-id 1\r\na=candidate:2943896220 1 udp 2122063615 192.168.29.242 53530 typ host generation 0 network-id 2 network-cost 10\r\na=candidate:1048604279 1 udp 2122197247 2405:201:5012:510e:35c4:49b8:a9b2:58ab 53531 typ host generation 0 network-id 3 network-cost 10\r\na=candidate:2836137395 1 udp 2122131711 2405:201:5012:510e:77cc:13c7:25e6:bfb1 53532 typ host generation 0 network-id 4 network-cost 10\r\na=candidate:3725478303 1 tcp 1518280447 172.30.192.1 9 typ host tcptype active generation 0 network-id 1\r\na=ice-ufrag:NSiw\r\na=ice-pwd:/cXkYeL4kTBiHxJGjmekThDi\r\na=ice-options:trickle\r\na=fingerprint:sha-256 01:08:4A:81:35:93:A2:5D:8E:04:A3:F3:A3:8E:72:AC:59:63:D2:47:60:FB:D8:0A:DA:E6:C3:A4:07:E7:1C:CD\r\na=setup:actpass\r\na=mid:0\r\na=sctp-port:5000\r\na=max-message-size:262144\r\n"}
VM771:1 New Ice Candidate! reprinting SDP {"type":"offer","sdp":"v=0\r\no=- 5565229606022261744 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0\r\na=extmap-allow-mixed\r\na=msid-semantic: WMS\r\nm=application 53529 UDP/DTLS/SCTP webrtc-datachannel\r\nc=IN IP4 172.30.192.1\r\na=candidate:2697046791 1 udp 2122260223 172.30.192.1 53529 typ host generation 0 network-id 1\r\na=candidate:2943896220 1 udp 2122063615 192.168.29.242 53530 typ host generation 0 network-id 2 network-cost 10\r\na=candidate:1048604279 1 udp 2122197247 2405:201:5012:510e:35c4:49b8:a9b2:58ab 53531 typ host generation 0 network-id 3 network-cost 10\r\na=candidate:2836137395 1 udp 2122131711 2405:201:5012:510e:77cc:13c7:25e6:bfb1 53532 typ host generation 0 network-id 4 network-cost 10\r\na=candidate:3725478303 1 tcp 1518280447 172.30.192.1 9 typ host tcptype active generation 0 network-id 1\r\na=candidate:3518474244 1 tcp 1518083839 192.168.29.242 9 typ host tcptype active generation 0 network-id 2 network-cost 10\r\na=ice-ufrag:NSiw\r\na=ice-pwd:/cXkYeL4kTBiHxJGjmekThDi\r\na=ice-options:trickle\r\na=fingerprint:sha-256 01:08:4A:81:35:93:A2:5D:8E:04:A3:F3:A3:8E:72:AC:59:63:D2:47:60:FB:D8:0A:DA:E6:C3:A4:07:E7:1C:CD\r\na=setup:actpass\r\na=mid:0\r\na=sctp-port:5000\r\na=max-message-size:262144\r\n"}
VM771:1 New Ice Candidate! reprinting SDP {"type":"offer","sdp":"v=0\r\no=- 5565229606022261744 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0\r\na=extmap-allow-mixed\r\na=msid-semantic: WMS\r\nm=application 53529 UDP/DTLS/SCTP webrtc-datachannel\r\nc=IN IP4 172.30.192.1\r\na=candidate:2697046791 1 udp 2122260223 172.30.192.1 53529 typ host generation 0 network-id 1\r\na=candidate:2943896220 1 udp 2122063615 192.168.29.242 53530 typ host generation 0 network-id 2 network-cost 10\r\na=candidate:1048604279 1 udp 2122197247 2405:201:5012:510e:35c4:49b8:a9b2:58ab 53531 typ host generation 0 network-id 3 network-cost 10\r\na=candidate:2836137395 1 udp 2122131711 2405:201:5012:510e:77cc:13c7:25e6:bfb1 53532 typ host generation 0 network-id 4 network-cost 10\r\na=candidate:3725478303 1 tcp 1518280447 172.30.192.1 9 typ host tcptype active generation 0 network-id 1\r\na=candidate:3518474244 1 tcp 1518083839 192.168.29.242 9 typ host tcptype active generation 0 network-id 2 network-cost 10\r\na=candidate:1078955247 1 tcp 1518217471 2405:201:5012:510e:35c4:49b8:a9b2:58ab 9 typ host tcptype active generation 0 network-id 3 network-cost 10\r\na=ice-ufrag:NSiw\r\na=ice-pwd:/cXkYeL4kTBiHxJGjmekThDi\r\na=ice-options:trickle\r\na=fingerprint:sha-256 01:08:4A:81:35:93:A2:5D:8E:04:A3:F3:A3:8E:72:AC:59:63:D2:47:60:FB:D8:0A:DA:E6:C3:A4:07:E7:1C:CD\r\na=setup:actpass\r\na=mid:0\r\na=sctp-port:5000\r\na=max-message-size:262144\r\n"}
VM771:1 New Ice Candidate! reprinting SDP {"type":"offer","sdp":"v=0\r\no=- 5565229606022261744 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0\r\na=extmap-allow-mixed\r\na=msid-semantic: WMS\r\nm=application 53529 UDP/DTLS/SCTP webrtc-datachannel\r\nc=IN IP4 172.30.192.1\r\na=candidate:2697046791 1 udp 2122260223 172.30.192.1 53529 typ host generation 0 network-id 1\r\na=candidate:2943896220 1 udp 2122063615 192.168.29.242 53530 typ host generation 0 network-id 2 network-cost 10\r\na=candidate:1048604279 1 udp 2122197247 2405:201:5012:510e:35c4:49b8:a9b2:58ab 53531 typ host generation 0 network-id 3 network-cost 10\r\na=candidate:2836137395 1 udp 2122131711 2405:201:5012:510e:77cc:13c7:25e6:bfb1 53532 typ host generation 0 network-id 4 network-cost 10\r\na=candidate:3725478303 1 tcp 1518280447 172.30.192.1 9 typ host tcptype active generation 0 network-id 1\r\na=candidate:3518474244 1 tcp 1518083839 192.168.29.242 9 typ host tcptype active generation 0 network-id 2 network-cost 10\r\na=candidate:1078955247 1 tcp 1518217471 2405:201:5012:510e:35c4:49b8:a9b2:58ab 9 typ host tcptype active generation 0 network-id 3 network-cost 10\r\na=candidate:3619940139 1 tcp 1518151935 2405:201:5012:510e:77cc:13c7:25e6:bfb1 9 typ host tcptype active generation 0 network-id 4 network-cost 10\r\na=ice-ufrag:NSiw\r\na=ice-pwd:/cXkYeL4kTBiHxJGjmekThDi\r\na=ice-options:trickle\r\na=fingerprint:sha-256 01:08:4A:81:35:93:A2:5D:8E:04:A3:F3:A3:8E:72:AC:59:63:D2:47:60:FB:D8:0A:DA:E6:C3:A4:07:E7:1C:CD\r\na=setup:actpass\r\na=mid:0\r\na=sctp-port:5000\r\na=max-message-size:262144\r\n"}
VM771:1 New Ice Candidate! reprinting SDP {"type":"offer","sdp":"v=0\r\no=- 5565229606022261744 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0\r\na=extmap-allow-mixed\r\na=msid-semantic: WMS\r\nm=application 53529 UDP/DTLS/SCTP webrtc-datachannel\r\nc=IN IP4 172.30.192.1\r\na=candidate:2697046791 1 udp 2122260223 172.30.192.1 53529 typ host generation 0 network-id 1\r\na=candidate:2943896220 1 udp 2122063615 192.168.29.242 53530 typ host generation 0 network-id 2 network-cost 10\r\na=candidate:1048604279 1 udp 2122197247 2405:201:5012:510e:35c4:49b8:a9b2:58ab 53531 typ host generation 0 network-id 3 network-cost 10\r\na=candidate:2836137395 1 udp 2122131711 2405:201:5012:510e:77cc:13c7:25e6:bfb1 53532 typ host generation 0 network-id 4 network-cost 10\r\na=candidate:3725478303 1 tcp 1518280447 172.30.192.1 9 typ host tcptype active generation 0 network-id 1\r\na=candidate:3518474244 1 tcp 1518083839 192.168.29.242 9 typ host tcptype active generation 0 network-id 2 network-cost 10\r\na=candidate:1078955247 1 tcp 1518217471 2405:201:5012:510e:35c4:49b8:a9b2:58ab 9 typ host tcptype active generation 0 network-id 3 network-cost 10\r\na=candidate:3619940139 1 tcp 1518151935 2405:201:5012:510e:77cc:13c7:25e6:bfb1 9 typ host tcptype active generation 0 network-id 4 network-cost 10\r\na=ice-ufrag:NSiw\r\na=ice-pwd:/cXkYeL4kTBiHxJGjmekThDi\r\na=ice-options:trickle\r\na=fingerprint:sha-256 01:08:4A:81:35:93:A2:5D:8E:04:A3:F3:A3:8E:72:AC:59:63:D2:47:60:FB:D8:0A:DA:E6:C3:A4:07:E7:1C:CD\r\na=setup:actpass\r\na=mid:0\r\na=sctp-port:5000\r\na=max-message-size:262144\r\n"}
const answer = {"type":"answer","sdp":"v=0\r\no=mozilla...THIS_IS_SDPARTA-99.0 8468871755829785099 0 IN IP4 0.0.0.0\r\ns=-\r\nt=0 0\r\na=sendrecv\r\na=fingerprint:sha-256 05:A3:B1:31:16:DC:42:F8:96:F4:B4:02:1C:C3:A5:4F:4B:91:51:49:16:C3:97:EF:2C:C2:0C:BD:11:2F:20:0F\r\na=group:BUNDLE 0\r\na=ice-options:trickle\r\na=msid-semantic:WMS *\r\nm=application 9 UDP/DTLS/SCTP webrtc-datachannel\r\nc=IN IP4 0.0.0.0\r\na=candidate:0 1 UDP 2122187007 af2c1135-4133-48dc-a0c0-5b88797e947b.local 51980 typ host\r\na=candidate:1 1 UDP 2122252543 330ff41a-e517-4625-941a-16ff633bf018.local 51981 typ host\r\na=candidate:2 1 TCP 2105458943 af2c1135-4133-48dc-a0c0-5b88797e947b.local 9 typ host tcptype active\r\na=candidate:3 1 TCP 2105524479 330ff41a-e517-4625-941a-16ff633bf018.local 9 typ host tcptype active\r\na=sendrecv\r\na=end-of-candidates\r\na=ice-pwd:1c675516316ea5820ff988a4e03dd208\r\na=ice-ufrag:f9a9e5d6\r\na=mid:0\r\na=setup:active\r\na=sctp-port:5000\r\na=max-message-size:1073741823\r\n"}

undefined
lc.setRemoteDescription(answer);
Promise {<pending>}
VM509:1 connection open
dc.send("hello from chrome");
undefined
VM385:1 msg received hello from ff