Security News
OpenJS: “XZ Utils Cyberattack Likely Not an Isolated Incident”
OpenJS is warning of social engineering takeovers targeting open source projects after receiving a credible attempt on the foundation.
ice-breaker
Advanced tools
Weekly downloads
Readme
Ice-Breaker is a set of helper methods to ease the WebRTC Media connection process.
WebRTC (Web Real-Time Communication) is a collection of communications protocols and application programming interfaces that enable real-time communication over peer-to-peer connections. In order for these peers on different networks to locate one another, a form of discovery and media format negotiation must take place. Each peer will need to provide ICE candidates to the remote peer. The Session Description Protocol is used in this signaling process (RFC-4566).
Each ICE candidate describes a method which the originating peer is able to communicate, and each peer sends candidates in the order of discovery, until it runs out of suggestions. Once the two peers suggest a compatible candidate, media begins to flow.
Typically, ICE candidates provide the IP address and port from where the data is going to be exchanged, and the format can be found in RFC-5245, section 15.1. As an example:
'candidate:7 1 UDP 1677722111 13.93.207.159 43399 typ srflx raddr 11.1.221.7 rport 43399'
Ice-Breaker provides methods to parse this string into an object so the different fields can be easily inspected, to filter SDP files so only candidates using a specific transport protocol are used, etc.
candidateToJson
: convert ICE Candidates to a JSON objectvar IceBreaker = require('ice-breaker');
var parsedCandidate = IceBreaker.candidateToJson('candidate:7 1 UDP 1677722111 13.93.207.159 43399 typ srflx raddr 11.1.221.7 rport 43399');
console.log('>>> My parsed ICE candidate: ', parsedCandidate);
/* Should print:
>>> My parsed ICE candidate: { foundation: '7',
componentId: '1',
transport: 'UDP',
priority: '1677722111',
connectionAddress: '13.93.207.159',
port: '43399',
candidateType: 'srflx',
remoteConnectionAddress: '11.1.221.7',
remotePort: '43399' }
*/
filterSDPCandidatesByTransport
: filter ICE candidates in an SDP file by transport protocolvar IceBreaker = require('ice-breaker');
// Please notice this is just a section of an SDP file
var sdp = 'a=sendonly\r\n' +
'a=candidate:1 1 UDP 2013266431 1111::222:3aff:1111:4983 50791 typ host\r\n' +
'a=candidate:2 1 TCP 1019217151 1111::222:3aff:1111:4983 9 typ host tcptype active\r\n';
var filteredSdp = IceBreaker.filterSDPCandidatesByTransport(sdp, 'TCP');
console.log('>>> My filtered SDP: ', filteredSdp);
/* Should print:
>>> My filtered SDP: a=sendonly
a=candidate:2 1 TCP 1019217151 1111::222:3aff:1111:4983 9 typ host tcptype active
*/
getCandidatesFromSDP
: get an array of the ICE candidates (as objects) present in an SDP filevar IceBreaker = require('ice-breaker');
// Please notice this is just a section of an SDP file
var sdp = 'a=sendonly\r\n' +
'a=candidate:1 1 UDP 2013266431 1111::222:3aff:1111:4983 50791 typ host\r\n' +
'a=candidate:2 1 TCP 1019217151 1111::222:3aff:1111:4983 9 typ host tcptype active\r\n';
var iceCandidates = IceBreaker.getCandidatesFromSDP(sdp);
console.log('>>> ICE Candidates in my SDP file: ', iceCandidates);
/* Should print:
>>> ICE Candidates in my SDP file: [ { foundation: '1',
componentId: '1',
transport: 'UDP',
priority: '2013266431',
connectionAddress: '1111::222:3aff:1111:4983',
port: '50791',
candidateType: 'host' },
{ foundation: '2',
componentId: '1',
transport: 'TCP',
priority: '1019217151',
connectionAddress: '1111::222:3aff:1111:4983',
port: '9',
candidateType: 'host' } ]
*/
getUnparsedCandidatesFromSDP
: get an array of the ICE candidates (as strings) present in an SDP filevar IceBreaker = require('ice-breaker');
// Please notice this is just a section of an SDP file
var sdp = 'a=sendonly\r\n' +
'a=candidate:1 1 UDP 2013266431 1111::222:3aff:1111:4983 50791 typ host\r\n' +
'a=candidate:2 1 TCP 1019217151 1111::222:3aff:1111:4983 9 typ host tcptype active\r\n';
var iceCandidates = IceBreaker.getUnparsedCandidatesFromSDP(sdp);
console.log('>>> Unparsed ICE Candidates in my SDP file: ', iceCandidates);
/* Should print:
>>> ICE Candidates in my SDP file: [ 'candidate:1 1 UDP 2013266431 1111::222:3aff:1111:4983 50791 typ host',
'candidate:2 1 TCP 1019217151 1111::222:3aff:1111:4983 9 typ host tcptype active' ]
*/
Thank you for using this module! Feel free to contribute :)
MIT
FAQs
Set of helper methods to ease the WebRTC Media connection process.
The npm package ice-breaker receives a total of 1 weekly downloads. As such, ice-breaker popularity was classified as not popular.
We found that ice-breaker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
OpenJS is warning of social engineering takeovers targeting open source projects after receiving a credible attempt on the foundation.
Company News
Come meet the Socket team at BSidesSF and RSA! We're sponsoring several fun networking events and we would love to see you there.
Security News
OSI is starting a conversation aimed at removing the excuse of the SaaS loophole for companies navigating licensing and the complexities of doing business with open source.