{"id":44923362,"url":"https://github.com/ca9io/electron-wrtc-relay","last_synced_at":"2026-02-18T04:00:59.803Z","repository":{"id":37808371,"uuid":"506276873","full_name":"CA9io/electron-wrtc-relay","owner":"CA9io","description":"Drop-in replacement for wrtc in electron projects using a BrowserWindow and relaying its webrtc","archived":false,"fork":false,"pushed_at":"2023-09-20T14:22:25.000Z","size":309,"stargazers_count":7,"open_issues_count":4,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-28T10:33:49.784Z","etag":null,"topics":["electron","webrtc","wrtc"],"latest_commit_sha":null,"homepage":"https://ca9.io","language":"TypeScript","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/CA9io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-22T14:14:40.000Z","updated_at":"2025-10-15T04:22:37.000Z","dependencies_parsed_at":"2024-06-21T17:40:28.971Z","dependency_job_id":"d0be89ff-16b5-4b40-a033-42ee5197b12d","html_url":"https://github.com/CA9io/electron-wrtc-relay","commit_stats":{"total_commits":20,"total_committers":3,"mean_commits":6.666666666666667,"dds":0.25,"last_synced_commit":"b3cd5b8e11c627710aa852d3ffb80b4055a586fd"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/CA9io/electron-wrtc-relay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CA9io%2Felectron-wrtc-relay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CA9io%2Felectron-wrtc-relay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CA9io%2Felectron-wrtc-relay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CA9io%2Felectron-wrtc-relay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CA9io","download_url":"https://codeload.github.com/CA9io/electron-wrtc-relay/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CA9io%2Felectron-wrtc-relay/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29567616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T00:47:08.760Z","status":"online","status_checked_at":"2026-02-18T02:00:09.468Z","response_time":162,"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":["electron","webrtc","wrtc"],"created_at":"2026-02-18T04:00:41.757Z","updated_at":"2026-02-18T04:00:59.781Z","avatar_url":"https://github.com/CA9io.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\u003cb\u003eElectron Webrtc Relay\u003c/b\u003e\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://ca9.io\" target=\"_blank\"\u003e\n    \u003cimg width=\"150\" height=\"150\" src=\"https://cdn.ca9.io/branding/logo/windows11/Square150x150Logo.scale-200.png\"\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://ca9.io\"\u003e\u003cimg src=\"https://img.shields.io/badge/website-more_from_us-C0222C.svg?style=flat\u0026logo=PWA\"\u003e \u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.com/package/@ca9io/electron-webrtc-relay\"\u003e\u003cimg src=\"https://img.shields.io/npm/dw/@ca9io/electron-webrtc-relay?logo=Npm\"/\u003e \u003c/a\u003e\n\t\u003ca href=\"https://www.npmjs.com/package/@ca9io/electron-webrtc-relay\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@ca9io/electron-webrtc-relay.svg?logo=Npm\"\u003e\u003c/a\u003e\n\t\u003ca href=\"https://discord.ca9.io\"\u003e\u003cimg src=\"https://img.shields.io/discord/673169081704120334?label=discord\u0026style=flat\u0026color=5a66f6\u0026logo=Discord\"\u003e\u003c/a\u003e\n\t\u003ca href=\"https://twitter.com/ca9_io\"\u003e\u003cimg src=\"https://img.shields.io/badge/twitter-follow_us-1d9bf0.svg?style=flat\u0026logo=Twitter\"\u003e\u003c/a\u003e\n\t\u003ca href=\"https://www.linkedin.com/company/ca9/\"\u003e\u003cimg src=\"https://img.shields.io/badge/linkedin-connect-0a66c2.svg?style=flat\u0026logo=Linkedin\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://merch.ca9.io\"\u003e\u003cimg src=\"https://img.shields.io/badge/merch-support_us-red.svg?style=flat\u0026logo=Spreadshirt\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nUse **WebRTC** in the **Main Process** in your **Electron** project.\n\nWebRTC is a powerful web API that lets browsers make peer-to-peer connections, and has already been\ndeployed in [many popular browsers](http://caniuse.com/#feat=rtcpeerconnection). It may sometimes be\nuseful to let Node.js programs use WebRTC, e.g. in [`webtorrent-hybrid`](https://github.com/feross/webtorrent-hybrid). However, the modules for WebRTC in Node ([`node-webrtc`](https://github.com/js-platform/node-webrtc) and [`node-rtc-peer-connection`](https://github.com/nickdesaulniers/node-rtc-peer-connection)) are either hard to install, broken, or incomplete.\n\n\u003chr/\u003e\n\n**This module started as a fork of [electron-webrtc](https://www.npmjs.com/package/electron-webrtc) but removed the broken, unsafe and old electron dependencies of electron-eval and implemented some pending pull requests.**\n\u003chr/\u003e\n\n## Status\n\nThis module is compatible with [`simple-peer`](https://github.com/feross/simple-peer) and passes its tests [compatible but tests need an update ;)].\n\n`electron-webrtc-relay` is intended for use with RTCDataChannels, so the MediaStream API is not supported.\n\n## Usage\n\n`npm install @ca9io/electron-webrtc-relay`\n\n```js\n// call exported function to create Electron process\nvar wrtc = require(\"@ca9io/electron-webrtc-relay\")({\n  debug: false, //(optional) defaults to false\n  preload: string, //(optional) absolute path to your preload script. Using secure context if active (TODO: add example implementation)\n  webrtcPolicy:  \"default\" | \"default_public_interface_only\" | \"default_public_and_private_interfaces\" | \"disable_non_proxied_udp\" // (optional) default: \"default\". Read More: https://www.electronjs.org/docs/latest/api/web-contents#contentssetwebrtciphandlingpolicypolicy\n});\n\n// IMPORTANT: WHEN YOUR APP IS LOADED CALL\nwrtc.init()\n\n// handle errors that may occur when trying to communicate with Electron\nwrtc.on(\"error\", function (err) {\n  console.log(err);\n});\n\n// uses the same API as the `wrtc` package\nvar pc = new wrtc.RTCPeerConnection(config);\n\n// compatible with `simple-peer`\nvar peer = new SimplePeer({\n  initiator: true,\n  wrtc: wrtc,\n});\n\n// listen for errors\nwrtc.on(\"error\", function (err, source) {\n  console.error(err);\n});\n```\n### Configuration\n- `debug` - Enables output log and rendered Electron Window with devtools enabled\n- `preload` - You can link your custom preload script. Since Webpack will just remove our script we can not do that. You have to add the ipcRenderer Module to the window object in your script.\n- `webrtcPolicy` - Define how to handle WebRTC within your project. If default is active, local connections in your network are not possible (please verify this)\n- `maxWindows` - Chromium only allows for a certain amount of WebRTC connections per Window. With maxWindows you can allow the creation of more than one window to improve performance in performance heavy applications\n### Methods\n\n#### `var wrtc = require('@ca9io/electron-webrtc-relay')([opts])`\n\nCalling the function exported by this module will create a new hidden Electron Window.\n\nAn optional `opts` object may contain specific options.\n\nThe object returned by this function has the same API as the [`node-webrtc`](https://github.com/js-platform/node-webrtc) package.\n\nAny errors that occur when communicating with the Electron daemon will be emitted by the `wrtc` object (`wrtc.on('error', ...)`).\n\n#### `wrtc.init()`\n\nTells the relay to start a Browser window. It is important that you call this once.\n\n#### `wrtc.close()`\n\nFrees some resources.\n\n### Events\n\n#### - `error`\n\nEmitted by `RTCPeerConnection` or `RTCDataChannel` when `daemon.eval()` evaluates code that throws an internal error.\n## Related Modules\n\n- [`node-webrtc`](https://github.com/js-platform/node-webrtc)\n- [`node-rtc-peer-connection`](https://github.com/nickdesaulniers/node-rtc-peer-connection)\n- [`electron-eval`](https://github.com/mappum/electron-eval) (reference for the Bridge implementation)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fca9io%2Felectron-wrtc-relay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fca9io%2Felectron-wrtc-relay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fca9io%2Felectron-wrtc-relay/lists"}