Skip to content

Instantly share code, notes, and snippets.

@aisouard
Created May 24, 2015 15:09
Show Gist options
  • Save aisouard/6568521e3f567cf0f1b8 to your computer and use it in GitHub Desktop.
Save aisouard/6568521e3f567cf0f1b8 to your computer and use it in GitHub Desktop.
>npm test
> [email protected] test C:\Users\vm\node-webrtc
> node test/all.js
TAP version 13
# create a peer connection
ok 1 created
# createOffer function implemented
ok 2 implemented
# can call createOffer
ok 3 createOffer succeeded
ok 4 type === offer
ok 5 got sdp
# setLocalDescription function implemented
ok 6 implemented
# can call setLocalDescription
ok 7 local description set
ok 8 we have local sdp
# TODO: cleanup connection
ok 9 connection closed
# create a peer connection
ok 10 created
# createOffer
ok 11 createOffer succeeded
ok 12 type === offer
ok 13 got sdp
# setLocalDescription with a created RTCSessionDescription
ok 14 local description set
ok 15 we have local sdp
# TODO: cleanup connection
ok 16 connection closed
# create the peer connections
ok 17 peer:0 created ok
ok 18 peer:1 created ok
# peers are created and in the expected connection state
ok 19 should be equal
ok 20 should be equal
# create a datachannel on peer:0
ok 21 (unnamed assert)
ok 22 created with correct label
# createOffer for peer:0
ok 23 createOffer succeeded
ok 24 type === offer
ok 25 got sdp
# setLocalDescription for peer:0
ok 26 ok
# capture ice candidates for peer:0
{ type: 'icecandidate',
candidate:
{ candidate: 'candidate:547260449 1 udp 2122129151 10.0.2.15 49239 typ host generation 0',
sdpMid: 'data',
sdpMLineIndex: 0 } }
{ type: 'icecandidate',
candidate:
{ candidate: 'candidate:1749055319 1 udp 2122063615 192.168.56.101 49240 typ host generation 0',
sdpMid: 'data',
sdpMLineIndex: 0 } }
{ type: 'icecandidate',
candidate:
{ candidate: 'candidate:1847424209 1 tcp 1518149375 10.0.2.15 51207 typ host tcptype passive generation 0',
sdpMid: 'data',
sdpMLineIndex: 0 } }
{ type: 'icecandidate',
candidate:
{ candidate: 'candidate:650349479 1 tcp 1518083839 192.168.56.101 51208 typ host tcptype passive generation 0',
sdpMid: 'data',
sdpMLineIndex: 0 } }
{ type: 'icecandidate',
candidate:
{ candidate: 'candidate:1645442729 1 udp 1685921535 221.142.58.63 51725 typ srflx raddr 10.0.2.15 rport 49239 generation 0',
sdpMid: 'data',
sdpMLineIndex: 0 } }
ok 27 have candidates for peer:0
# setRemoteDescription for peer:1
ok 28 ok
# provide peer:1 with the peer:0 gathered ice candidates
ok 29 added candidate
ok 30 added candidate
ok 31 added candidate
ok 32 added candidate
ok 33 added candidate
# createAnswer for peer:1
ok 34 createOffer succeeded
ok 35 type === answer
ok 36 got sdp
# setLocalDescription for peer:1
ok 37 ok
# capture ice candidates for peer:1
{ type: 'icecandidate',
candidate:
{ candidate: 'candidate:547260449 1 udp 2122129151 10.0.2.15 55279 typ host generation 0',
sdpMid: 'data',
sdpMLineIndex: 0 } }
{ type: 'icecandidate',
candidate:
{ candidate: 'candidate:1749055319 1 udp 2122063615 192.168.56.101 55280 typ host generation 0',
sdpMid: 'data',
sdpMLineIndex: 0 } }
{ type: 'icecandidate',
candidate:
{ candidate: 'candidate:1645442729 1 udp 1685921535 221.142.58.63 35185 typ srflx raddr 10.0.2.15 rport 55279 generation 0',
sdpMid: 'data',
sdpMLineIndex: 0 } }
{ type: 'icecandidate',
candidate:
{ candidate: 'candidate:1847424209 1 tcp 1518149375 10.0.2.15 51209 typ host tcptype passive generation 0',
sdpMid: 'data',
sdpMLineIndex: 0 } }
{ type: 'icecandidate',
candidate:
{ candidate: 'candidate:650349479 1 tcp 1518083839 192.168.56.101 51212 typ host tcptype passive generation 0',
sdpMid: 'data',
sdpMLineIndex: 0 } }
ok 38 have candidates for peer:1
# setRemoteDescription for peer:0
ok 39 ok
# provide peer:0 with the peer:1 gathered ice candidates
ok 40 added candidate
ok 41 added candidate
ok 42 added candidate
ok 43 added candidate
ok 44 added candidate
# peer:1 triggers data channel event
ok 45 got data channel
ok 46 data channel has correct label
# monitor the ice connection state of peer:0
ok 47 peer:0 in connected state
# monitor the ice connection state of peer:1
ok 48 peer:1 in connected state
# data channel connectivity
ok 49 successfully called send on dc:0
ok 50 got valid data
ok 51 two bytes sent
ok 52 byte:0 matches expected
ok 53 byte:1 matches expected
# getStats
[ { timestamp: 1432479626731,
type: 'remotecandidate',
ipAddress: '10.0.2.15',
portNumber: '55279',
priority: '2122129151',
candidateType: 'host',
transport: 'udp' },
{ timestamp: 1432479626731,
type: 'localcandidate',
networkType: 'unknown',
ipAddress: '192.168.56.101',
portNumber: '51208',
priority: '1518083839',
candidateType: 'host',
transport: 'tcp' },
{ timestamp: 1432479626731,
type: 'localcandidate',
networkType: 'unknown',
ipAddress: '10.0.2.15',
portNumber: '51207',
priority: '1518149375',
candidateType: 'host',
transport: 'tcp' },
{ timestamp: 1432479626731,
type: 'localcandidate',
networkType: 'unknown',
ipAddress: '10.0.2.15',
portNumber: '49239',
priority: '2122129151',
candidateType: 'host',
transport: 'udp' },
{ timestamp: 1432479626731,
type: 'remotecandidate',
ipAddress: '192.168.56.101',
portNumber: '51214',
priority: '1853628159',
candidateType: 'peerreflexive',
transport: 'tcp' },
{ timestamp: 1432479626731,
type: 'remotecandidate',
ipAddress: '10.0.2.15',
portNumber: '51210',
priority: '1853693695',
candidateType: 'peerreflexive',
transport: 'tcp' },
{ timestamp: 1432479626731,
type: 'localcandidate',
networkType: 'unknown',
ipAddress: '192.168.56.101',
portNumber: '49240',
priority: '2122063615',
candidateType: 'host',
transport: 'udp' },
{ timestamp: 1432479626731,
type: 'googComponent',
googComponent: '1',
googLocalCertificateId: 'googCertificate_65:71:F9:D6:F5:AB:EC:47:25:A2:9B:D0:E4:2C:1D:45:65:10:86:13',
googRemoteCertificateId: 'googCertificate_5C:00:CD:23:54:26:8D:B2:8E:24:B2:21:13:6B:BE:EB:44:8D:4C:20' },
{ timestamp: 1432479626731,
type: 'googCandidatePair',
googChannelId: 'Channel-data-1',
bytesSent: '2824',
packetsDiscardedOnSend: '0',
packetsSent: '8',
bytesReceived: '2092',
googWritable: 'true',
googReadable: 'true',
googActiveConnection: 'true',
localCandidateId: 'Cand-Jey1rNz+',
remoteCandidateId: 'Cand-',
googLocalAddress: '10.0.2.15:49239',
googRemoteAddress: '10.0.2.15:55279',
googRtt: '2250',
googTransportType: 'udp',
googLocalCandidateType: 'local',
googRemoteCandidateType: 'local' },
{ timestamp: 1432479626731,
type: 'googCandidatePair',
googChannelId: 'Channel-data-1',
bytesSent: '0',
packetsDiscardedOnSend: '0',
packetsSent: '0',
bytesReceived: '0',
googWritable: 'false',
googReadable: 'false',
googActiveConnection: 'false',
localCandidateId: 'Cand-hGk9Rhxp',
remoteCandidateId: 'Cand-',
googLocalAddress: '192.168.56.101:49240',
googRemoteAddress: '10.0.2.15:55279',
googRtt: '3000',
googTransportType: 'udp',
googLocalCandidateType: 'local',
googRemoteCandidateType: 'local' },
{ timestamp: 1432479626731,
type: 'googCandidatePair',
googChannelId: 'Channel-data-1',
bytesSent: '0',
packetsDiscardedOnSend: '0',
packetsSent: '0',
bytesReceived: '0',
googWritable: 'false',
googReadable: 'false',
googActiveConnection: 'false',
localCandidateId: 'Cand-hGk9Rhxp',
remoteCandidateId: 'Cand-',
googLocalAddress: '192.168.56.101:49240',
googRemoteAddress: '192.168.56.101:55280',
googRtt: '3000',
googTransportType: 'udp',
googLocalCandidateType: 'local',
googRemoteCandidateType: 'local' },
{ timestamp: 1432479626731,
type: 'googCandidatePair',
googChannelId: 'Channel-data-1',
bytesSent: '0',
packetsDiscardedOnSend: '0',
packetsSent: '0',
bytesReceived: '0',
googWritable: 'false',
googReadable: 'false',
googActiveConnection: 'false',
localCandidateId: 'Cand-hGk9Rhxp',
remoteCandidateId: 'Cand-',
googLocalAddress: '192.168.56.101:49240',
googRemoteAddress: '221.142.58.63:35185',
googRtt: '3000',
googTransportType: 'udp',
googLocalCandidateType: 'local',
googRemoteCandidateType: 'stun' },
{ timestamp: 1432479626731,
type: 'googCandidatePair',
googChannelId: 'Channel-data-1',
bytesSent: '0',
packetsDiscardedOnSend: '0',
packetsSent: '0',
bytesReceived: '0',
googWritable: 'false',
googReadable: 'true',
googActiveConnection: 'false',
localCandidateId: 'Cand-2Qi73Do7',
remoteCandidateId: 'Cand-NQ2H7keT',
googLocalAddress: '192.168.56.101:51208',
googRemoteAddress: '192.168.56.101:51214',
googRtt: '3000',
googTransportType: 'tcp',
googLocalCandidateType: 'local',
googRemoteCandidateType: 'prflx' },
{ timestamp: 1432479626731,
type: 'googCandidatePair',
googChannelId: 'Channel-data-1',
bytesSent: '0',
packetsDiscardedOnSend: '0',
packetsSent: '0',
bytesReceived: '0',
googWritable: 'false',
googReadable: 'false',
googActiveConnection: 'false',
localCandidateId: 'Cand-2Qi73Do7',
remoteCandidateId: 'Cand-',
googLocalAddress: '192.168.56.101:51208',
googRemoteAddress: '192.168.56.101:51212',
googRtt: '3000',
googTransportType: 'tcp',
googLocalCandidateType: 'local',
googRemoteCandidateType: 'local' },
{ timestamp: 1432479626731,
type: 'googCandidatePair',
googChannelId: 'Channel-data-1',
bytesSent: '0',
packetsDiscardedOnSend: '0',
packetsSent: '0',
bytesReceived: '0',
googWritable: 'false',
googReadable: 'true',
googActiveConnection: 'false',
localCandidateId: 'Cand-BSGvm7fu',
remoteCandidateId: 'Cand-QB2nd3eD',
googLocalAddress: '10.0.2.15:51207',
googRemoteAddress: '10.0.2.15:51210',
googRtt: '3000',
googTransportType: 'tcp',
googLocalCandidateType: 'local',
googRemoteCandidateType: 'prflx' },
{ timestamp: 1432479626731,
type: 'googCertificate',
googFingerprint: '5C:00:CD:23:54:26:8D:B2:8E:24:B2:21:13:6B:BE:EB:44:8D:4C:20',
googFingerprintAlgorithm: 'sha-1',
googDerBase64: 'MIIBmTCCAQICCQD4/mQnaRKc+TANBgkqhkiG9w0BAQUFADARMQ8wDQYDVQQDDAZXZWJSVEMwHhcNMTUwNTIzMTUwMDA2WhcNMTUwNjIzMTUwMDA2WjARMQ8wDQYDVQQDDAZXZWJSVEMwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMoHBHLnaibqdrB8Jh3LbfofpzAQXh4k25gQiuUYXcA0JcXCcy/st4RaVwj9a9Sy0znnjlMMW0FGojUtYcxF1CDLmi/k6eRCa6S/CThHpXnjUEs69irYIjfL6gFO6Dhop0XpafQptbID2xF2e9dlDUeeVnIuNPM+obj6VWUELKF1AgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAZzmAve5IWZv9s8q2TNxD0vBLD7P1TF+5XDxRKpRqt2+g0wghJqIm40uji+Kfm28q3417s0XFVKPxvQUjKEpA3BON/zRjfRwieuUvjdB3q0taGQuTssnawLlNw1auwp4fioe3cD2REmeHgE9bT+p5GCovt8/V/neOmNRvOJtB22c=' },
{ timestamp: 1432479626731,
type: 'googCertificate',
googFingerprint: '65:71:F9:D6:F5:AB:EC:47:25:A2:9B:D0:E4:2C:1D:45:65:10:86:13',
googFingerprintAlgorithm: 'sha-1',
googDerBase64: 'MIIBmTCCAQICCQDo+nFwA3EXTDANBgkqhkiG9w0BAQUFADARMQ8wDQYDVQQDDAZXZWJSVEMwHhcNMTUwNTIzMTUwMDA2WhcNMTUwNjIzMTUwMDA2WjARMQ8wDQYDVQQDDAZXZWJSVEMwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAL7nIE72e44z4wrliQyBY+njMoEMGiYxZFFvfV/H85Pl1nZiX5mQtyxH6RqIaKEWs2HkIH7UsS4nRqzkQ/dEOG4cb/qcOvKMtJCp3tE76PoFP2J4NMB3+UZarcPFc2HkMhFyDsFth/m/4BdgY6l7WIcVqTYbP0A1EClCKvrRX+vrAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAkrbEDja6rGiDdxupCaKO4C9+OBx53ZLdU1j9FjnZfvIl+hGfqZx4DDY3BokZPvlNRIzLsPX65tvv8m+T94GBFtSUU1ZcBlq/zQQn5Tv2iVL88BoCO92LjkWPf8ozVv/ua2u29wamPeW5KBpJTMMtddIE73eVOXm+8SD5G2HuMmM=' },
{ timestamp: 1432479626731,
type: 'googLibjingleSession',
googInitiator: 'true' } ]
ok 54 successfully called getStats
[ { timestamp: 1432479626731,
type: 'remotecandidate',
ipAddress: '10.0.2.15',
portNumber: '49239',
priority: '2122129151',
candidateType: 'host',
transport: 'udp' },
{ timestamp: 1432479626731,
type: 'localcandidate',
networkType: 'unknown',
ipAddress: '192.168.56.101',
portNumber: '51214',
priority: '1853628159',
candidateType: 'peerreflexive',
transport: 'tcp' },
{ timestamp: 1432479626731,
type: 'localcandidate',
networkType: 'unknown',
ipAddress: '10.0.2.15',
portNumber: '55279',
priority: '2122129151',
candidateType: 'host',
transport: 'udp' },
{ timestamp: 1432479626731,
type: 'localcandidate',
networkType: 'unknown',
ipAddress: '192.168.56.101',
portNumber: '55280',
priority: '2122063615',
candidateType: 'host',
transport: 'udp' },
{ timestamp: 1432479626731,
type: 'googComponent',
googComponent: '1',
googLocalCertificateId: 'googCertificate_5C:00:CD:23:54:26:8D:B2:8E:24:B2:21:13:6B:BE:EB:44:8D:4C:20',
googRemoteCertificateId: 'googCertificate_65:71:F9:D6:F5:AB:EC:47:25:A2:9B:D0:E4:2C:1D:45:65:10:86:13' },
{ timestamp: 1432479626731,
type: 'googCandidatePair',
googChannelId: 'Channel-data-1',
bytesSent: '2092',
packetsDiscardedOnSend: '0',
packetsSent: '7',
bytesReceived: '2824',
googWritable: 'true',
googReadable: 'true',
googActiveConnection: 'true',
localCandidateId: 'Cand-Q+Yfa1VM',
remoteCandidateId: 'Cand-',
googLocalAddress: '10.0.2.15:55279',
googRemoteAddress: '10.0.2.15:49239',
googRtt: '2250',
googTransportType: 'udp',
googLocalCandidateType: 'local',
googRemoteCandidateType: 'local' },
{ timestamp: 1432479626731,
type: 'googCandidatePair',
googChannelId: 'Channel-data-1',
bytesSent: '0',
packetsDiscardedOnSend: '0',
packetsSent: '0',
bytesReceived: '0',
googWritable: 'true',
googReadable: 'false',
googActiveConnection: 'false',
localCandidateId: 'Cand-2fkkUija',
remoteCandidateId: 'Cand-',
googLocalAddress: '192.168.56.101:51214',
googRemoteAddress: '192.168.56.101:51208',
googRtt: '2251',
googTransportType: 'tcp',
googLocalCandidateType: 'prflx',
googRemoteCandidateType: 'local' },
{ timestamp: 1432479626731,
type: 'googCandidatePair',
googChannelId: 'Channel-data-1',
bytesSent: '0',
packetsDiscardedOnSend: '0',
packetsSent: '0',
bytesReceived: '0',
googWritable: 'false',
googReadable: 'false',
googActiveConnection: 'false',
localCandidateId: 'Cand-cHBkH90l',
remoteCandidateId: 'Cand-',
googLocalAddress: '192.168.56.101:55280',
googRemoteAddress: '10.0.2.15:49239',
googRtt: '3000',
googTransportType: 'udp',
googLocalCandidateType: 'local',
googRemoteCandidateType: 'local' },
{ timestamp: 1432479626731,
type: 'googCandidatePair',
googChannelId: 'Channel-data-1',
bytesSent: '0',
packetsDiscardedOnSend: '0',
packetsSent: '0',
bytesReceived: '0',
googWritable: 'false',
googReadable: 'false',
googActiveConnection: 'false',
localCandidateId: 'Cand-cHBkH90l',
remoteCandidateId: 'Cand-',
googLocalAddress: '192.168.56.101:55280',
googRemoteAddress: '192.168.56.101:49240',
googRtt: '3000',
googTransportType: 'udp',
googLocalCandidateType: 'local',
googRemoteCandidateType: 'local' },
{ timestamp: 1432479626731,
type: 'googCandidatePair',
googChannelId: 'Channel-data-1',
bytesSent: '0',
packetsDiscardedOnSend: '0',
packetsSent: '0',
bytesReceived: '0',
googWritable: 'false',
googReadable: 'false',
googActiveConnection: 'false',
localCandidateId: 'Cand-cHBkH90l',
remoteCandidateId: 'Cand-',
googLocalAddress: '192.168.56.101:55280',
googRemoteAddress: '221.142.58.63:51725',
googRtt: '3000',
googTransportType: 'udp',
googLocalCandidateType: 'local',
googRemoteCandidateType: 'stun' },
{ timestamp: 1432479626731,
type: 'googCertificate',
googFingerprint: '5C:00:CD:23:54:26:8D:B2:8E:24:B2:21:13:6B:BE:EB:44:8D:4C:20',
googFingerprintAlgorithm: 'sha-1',
googDerBase64: 'MIIBmTCCAQICCQD4/mQnaRKc+TANBgkqhkiG9w0BAQUFADARMQ8wDQYDVQQDDAZXZWJSVEMwHhcNMTUwNTIzMTUwMDA2WhcNMTUwNjIzMTUwMDA2WjARMQ8wDQYDVQQDDAZXZWJSVEMwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMoHBHLnaibqdrB8Jh3LbfofpzAQXh4k25gQiuUYXcA0JcXCcy/st4RaVwj9a9Sy0znnjlMMW0FGojUtYcxF1CDLmi/k6eRCa6S/CThHpXnjUEs69irYIjfL6gFO6Dhop0XpafQptbID2xF2e9dlDUeeVnIuNPM+obj6VWUELKF1AgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAZzmAve5IWZv9s8q2TNxD0vBLD7P1TF+5XDxRKpRqt2+g0wghJqIm40uji+Kfm28q3417s0XFVKPxvQUjKEpA3BON/zRjfRwieuUvjdB3q0taGQuTssnawLlNw1auwp4fioe3cD2REmeHgE9bT+p5GCovt8/V/neOmNRvOJtB22c=' },
{ timestamp: 1432479626731,
type: 'googCertificate',
googFingerprint: '65:71:F9:D6:F5:AB:EC:47:25:A2:9B:D0:E4:2C:1D:45:65:10:86:13',
googFingerprintAlgorithm: 'sha-1',
googDerBase64: 'MIIBmTCCAQICCQDo+nFwA3EXTDANBgkqhkiG9w0BAQUFADARMQ8wDQYDVQQDDAZXZWJSVEMwHhcNMTUwNTIzMTUwMDA2WhcNMTUwNjIzMTUwMDA2WjARMQ8wDQYDVQQDDAZXZWJSVEMwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAL7nIE72e44z4wrliQyBY+njMoEMGiYxZFFvfV/H85Pl1nZiX5mQtyxH6RqIaKEWs2HkIH7UsS4nRqzkQ/dEOG4cb/qcOvKMtJCp3tE76PoFP2J4NMB3+UZarcPFc2HkMhFyDsFth/m/4BdgY6l7WIcVqTYbP0A1EClCKvrRX+vrAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAkrbEDja6rGiDdxupCaKO4C9+OBx53ZLdU1j9FjnZfvIl+hGfqZx4DDY3BokZPvlNRIzLsPX65tvv8m+T94GBFtSUU1ZcBlq/zQQn5Tv2iVL88BoCO92LjkWPf8ozVv/ua2u29wamPeW5KBpJTMMtddIE73eVOXm+8SD5G2HuMmM=' },
{ timestamp: 1432479626731,
type: 'googLibjingleSession',
googInitiator: 'false' } ]
ok 55 successfully called getStats
# close the connections
ok 56 closed connections
# bwtest default
SENDING: sent 0 received 0. congestion #0 0.000 seconds. took 0.000 seconds. bandwidth NaN KB/s.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment