{"id":32963562,"url":"https://github.com/marifehe/ice-breaker","last_synced_at":"2026-04-09T00:02:05.735Z","repository":{"id":57270759,"uuid":"93591069","full_name":"marifehe/ice-breaker","owner":"marifehe","description":"Set of helper methods to ease the WebRTC Media connection process","archived":false,"fork":false,"pushed_at":"2018-09-05T10:42:36.000Z","size":22,"stargazers_count":14,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-01-02T13:50:31.024Z","etag":null,"topics":["ice","icecandidate","stun","turn","webrtc"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/ice-breaker","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marifehe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-07T04:02:57.000Z","updated_at":"2021-07-29T00:03:33.000Z","dependencies_parsed_at":"2022-09-06T21:52:44.207Z","dependency_job_id":null,"html_url":"https://github.com/marifehe/ice-breaker","commit_stats":null,"previous_names":["marifehe/ice-breaker","elbecita/ice-breaker"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/marifehe/ice-breaker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marifehe%2Fice-breaker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marifehe%2Fice-breaker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marifehe%2Fice-breaker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marifehe%2Fice-breaker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marifehe","download_url":"https://codeload.github.com/marifehe/ice-breaker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marifehe%2Fice-breaker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31579058,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ice","icecandidate","stun","turn","webrtc"],"created_at":"2025-11-13T01:01:03.041Z","updated_at":"2026-04-09T00:02:05.683Z","avatar_url":"https://github.com/marifehe.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Ice-Breaker [![npm version](https://badge.fury.io/js/ice-breaker.svg)](https://badge.fury.io/js/ice-breaker)\n=========\n\nIce-Breaker is a set of helper methods to ease the WebRTC Media connection process.\n\nContext\n-----\n**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](https://tools.ietf.org/html/rfc4566)).\n\nEach 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.\n\nTypically, 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](https://tools.ietf.org/html/rfc5245#section-15.1). As an example:\n```\n'candidate:7 1 UDP 1677722111 13.93.207.159 43399 typ srflx raddr 11.1.221.7 rport 43399'\n```\n**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.\n\nHow to use\n----\n\n#### `candidateToJson`: convert ICE Candidates to a JSON object\n\n```javascript\nvar IceBreaker = require('ice-breaker');\n\nvar parsedCandidate = IceBreaker.candidateToJson('candidate:7 1 UDP 1677722111 13.93.207.159 43399 typ srflx raddr 11.1.221.7 rport 43399');\n\nconsole.log('\u003e\u003e\u003e My parsed ICE candidate: ', parsedCandidate);\n/* Should print:\n\u003e\u003e\u003e My parsed ICE candidate:  { foundation: '7',\n  componentId: '1',\n  transport: 'UDP',\n  priority: '1677722111',\n  connectionAddress: '13.93.207.159',\n  port: '43399',\n  candidateType: 'srflx',\n  remoteConnectionAddress: '11.1.221.7',\n  remotePort: '43399' }\n*/\n```\n#### `filterSDPCandidatesByTransport`: filter ICE candidates in an SDP file by transport protocol\n\n```javascript\nvar IceBreaker = require('ice-breaker');\n\n// Please notice this is just a section of an SDP file\nvar sdp = 'a=sendonly\\r\\n' +\n  'a=candidate:1 1 UDP 2013266431 1111::222:3aff:1111:4983 50791 typ host\\r\\n' +\n  'a=candidate:2 1 TCP 1019217151 1111::222:3aff:1111:4983 9 typ host tcptype active\\r\\n';\n      \nvar filteredSdp = IceBreaker.filterSDPCandidatesByTransport(sdp, 'TCP');\n\nconsole.log('\u003e\u003e\u003e My filtered SDP: ', filteredSdp);\n/* Should print:\n\u003e\u003e\u003e My filtered SDP:  a=sendonly\n  a=candidate:2 1 TCP 1019217151 1111::222:3aff:1111:4983 9 typ host tcptype active\n*/\n```\n\n#### `getCandidatesFromSDP`: get an array of the ICE candidates (as objects) present in an SDP file\n\n```javascript\nvar IceBreaker = require('ice-breaker');\n\n// Please notice this is just a section of an SDP file\nvar sdp = 'a=sendonly\\r\\n' +\n  'a=candidate:1 1 UDP 2013266431 1111::222:3aff:1111:4983 50791 typ host\\r\\n' +\n  'a=candidate:2 1 TCP 1019217151 1111::222:3aff:1111:4983 9 typ host tcptype active\\r\\n';\n      \nvar iceCandidates = IceBreaker.getCandidatesFromSDP(sdp);\n\nconsole.log('\u003e\u003e\u003e ICE Candidates in my SDP file: ', iceCandidates);\n/* Should print:\n\u003e\u003e\u003e ICE Candidates in my SDP file:   [ { foundation: '1',\n    componentId: '1',\n    transport: 'UDP',\n    priority: '2013266431',\n    connectionAddress: '1111::222:3aff:1111:4983',\n    port: '50791',\n    candidateType: 'host' },\n  { foundation: '2',\n    componentId: '1',\n    transport: 'TCP',\n    priority: '1019217151',\n    connectionAddress: '1111::222:3aff:1111:4983',\n    port: '9',\n    candidateType: 'host' } ]\n*/\n```\n\n#### `getUnparsedCandidatesFromSDP`: get an array of the ICE candidates (as strings) present in an SDP file\n\n```javascript\nvar IceBreaker = require('ice-breaker');\n\n// Please notice this is just a section of an SDP file\nvar sdp = 'a=sendonly\\r\\n' +\n  'a=candidate:1 1 UDP 2013266431 1111::222:3aff:1111:4983 50791 typ host\\r\\n' +\n  'a=candidate:2 1 TCP 1019217151 1111::222:3aff:1111:4983 9 typ host tcptype active\\r\\n';\n      \nvar iceCandidates = IceBreaker.getUnparsedCandidatesFromSDP(sdp);\n\nconsole.log('\u003e\u003e\u003e Unparsed ICE Candidates in my SDP file: ', iceCandidates);\n/* Should print:\n\u003e\u003e\u003e ICE Candidates in my SDP file:   [ 'candidate:1 1 UDP 2013266431 1111::222:3aff:1111:4983 50791 typ host',\n  'candidate:2 1 TCP 1019217151 1111::222:3aff:1111:4983 9 typ host tcptype active' ]\n\n*/\n```\n\n---\nThank you for using this module! Feel free to contribute :)\n\nLicense\n----\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarifehe%2Fice-breaker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarifehe%2Fice-breaker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarifehe%2Fice-breaker/lists"}