{"id":18664775,"url":"https://github.com/innovailable/node-libnice","last_synced_at":"2025-08-18T19:05:05.557Z","repository":{"id":15002636,"uuid":"17728103","full_name":"Innovailable/node-libnice","owner":"Innovailable","description":"A thin wrapper around the ICE library libnice","archived":false,"fork":false,"pushed_at":"2015-12-01T18:44:27.000Z","size":34,"stargazers_count":16,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-17T04:14:38.800Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Innovailable.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-13T22:22:29.000Z","updated_at":"2025-05-11T07:50:13.000Z","dependencies_parsed_at":"2022-08-30T12:11:43.558Z","dependency_job_id":null,"html_url":"https://github.com/Innovailable/node-libnice","commit_stats":null,"previous_names":["thammi/node-libnice"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Innovailable/node-libnice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Innovailable%2Fnode-libnice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Innovailable%2Fnode-libnice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Innovailable%2Fnode-libnice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Innovailable%2Fnode-libnice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Innovailable","download_url":"https://codeload.github.com/Innovailable/node-libnice/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Innovailable%2Fnode-libnice/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271043504,"owners_count":24689767,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-07T08:24:54.414Z","updated_at":"2025-08-18T19:05:05.517Z","avatar_url":"https://github.com/Innovailable.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-libnice\n\n## What is this?\n\nThis is a thin node.js wrapper around [libnice](http://nice.freedesktop.org/).\nIt provides\n[ICE](http://en.wikipedia.org/wiki/Interactive_Connectivity_Establishment)\n(Interactive Connectivity Establishment) support, which is a protocol for NAT\ntraversal. ICE is primarily used in peer-to-peer applications like VoIP, video\nconferences, and instant messaging. It is part of SIP and WebRTC.\n\n## Setup\n\nYou have to make sure that you have libnice \u003e=1.4 and its headers are\ninstalled. On Debian/Ubuntu/... run\n\n\tapt-get install libnice-dev\n\nThen install this library with\n\n\tnpm install libnice\n\n## Usage\n\nFirst you have to create an agent which can create streams\n\n\tvar agent = new require(\"libnice\").NiceAgent();\n\tagent.setStunServer(\"132.177.123.6\");\n\nAn important concept in libnice are components. A stream can consist of\nmultiple components which are something like channels. Each component can send\nand receive data. To create a stream with one component call\n\n\tvar stream = agent.createStream(1);\n\nStreams are `EventEmitter`s. Register your callbacks\n\n\tstream.on('gatheringDone', function(candidates) {\n\t    // candidates is an array of sdp strings\n\t    var credentials = stream.getLocalCredentials();\n\t    // send credentials and candidates to remote client\n\t});\n\n\tstream.on('stateChanged', function(component, state) {\n\t\t// state is a string\n\t}\n\n\tstream.on('receive', function(component, data) {\n\t    // data is a buffer\n\t});\n\nPlease note that the first parameter on `stateChanged` and `receive` is the\ncomponent id. Component ids are numbers starting from 1.\n\nTo start the connection process tell the stream to gather candidates\n\n\tstream.gatherCandidates();\n\nNow you have to exchange the credentials and ice candidates with the other\nclient\n\n\tstream.setRemoteCredentials(ufrag, pwd);\n\tstream.addRemoteCandidate(candidate1);\n\tstream.addRemoteCandidate(candidate2);\n\nWhen everything is set up and the clients are able to connect to each other you\nshould arrive in the state `ready`. Now you can now send and receive data\n\n\tstream.send(component, data)\n\nFull API documentation will be added shortly. Please also consult the [libnice\ndocumentation](http://nice.freedesktop.org/libnice/index.html) for detailed\ninformation.\n\n## TODOs\n\n* more documentation\n* resolve host for stun servers\n* port missing libnice functions\n* get rid of the glib loop in its own thread\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finnovailable%2Fnode-libnice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finnovailable%2Fnode-libnice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finnovailable%2Fnode-libnice/lists"}