Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
957 changes: 494 additions & 463 deletions CMakeLists.txt

Large diffs are not rendered by default.

142 changes: 79 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,74 +1,90 @@
<h1 align="center">
<img height="120px" src="https://upload.wikimedia.org/wikipedia/commons/d/d9/Node.js_logo.svg">&nbsp;&nbsp;&nbsp;&nbsp;
<img height="120px" src="https://webrtc.github.io/webrtc-org/assets/images/webrtc-logo-vert-retro-dist.svg">
</h1>

[![NPM](https://img.shields.io/npm/v/@roamhq/wrtc.svg)](https://www.npmjs.com/package/@roamhq/wrtc)

node-webrtc is a Node.js Native Addon that provides bindings to [WebRTC
M106](https://webrtc.googlesource.com/src/+/branch-heads/5249). This project is
<h1 align="center">
<img height="120px" src="https://upload.wikimedia.org/wikipedia/commons/d/d9/Node.js_logo.svg">&nbsp;&nbsp;&nbsp;&nbsp;
<img height="120px" src="https://webrtc.github.io/webrtc-org/assets/images/webrtc-logo-vert-retro-dist.svg">
</h1>

[![NPM](https://img.shields.io/npm/v/@roamhq/wrtc.svg)](https://www.npmjs.com/package/@roamhq/wrtc)

node-webrtc is a Node.js Native Addon that provides bindings to libwebrtc. This project is
aiming for spec-compliance and will eventually be tested using the W3C's
[web-platform-tests](https://github.com/web-platform-tests/wpt) project. A
number of [nonstandard APIs](docs/nonstandard-apis.md) for testing are also
included.

## Install

```
npm install @roamhq/wrtc
```

Installing from NPM downloads a prebuilt binary for your operating system ×
architecture, based on optional dependency filters.

This fork defaults to `branch-heads/5735` and supports overriding the upstream
libwebrtc ref at build time with `WEBRTC_REVISION=<ref>`.

## Install

```
npm install @roamhq/wrtc
```

Installing from NPM downloads a prebuilt binary for your operating system ×
architecture, based on optional dependency filters.

To install a debug build or cross-compile, you should [build from
source](docs/build-from-source.md).

## Supported Platforms

The following platforms are confirmed to work with node-webrtc and have
prebuilt binaries available. Since node-webrtc targets [N-API version
3](https://nodejs.org/api/n-api.html), there may be additional platforms
supported that are not listed here. If your platform is not supported, you may
still be able to [build from source](docs/build-from-source.md).
To experiment with a different upstream libwebrtc revision when debugging a
native networking issue:

<table>
<thead>
<tr>
<td colspan="2" rowspan="2"></td>
<th colspan="2">Linux</th>
<th colspan="2">macOS</th>
<th>Windows</th>
</tr>
<tr>
<th>x64</th>
<th>arm64</th>
<th>x64</th>
<th>arm64</th>
<th>x64</th>
</tr>
</thead>
<tbody>
<tr>
<th rowspan="2">Node</th>
<th>20</th>
<td align="center">✓</td>
<td align="center">?</td>
<td align="center">✓</td>
<td align="center">✓</td>
<td align="center">✓</td>
</tr>
<tr>
<th>22</th>
<td align="center">✓</td>
<td align="center">?</td>
<td align="center">✓</td>
<td align="center">✓</td>
<td align="center">✓</td>
</tr>
</tbody>
</table>
```bash
WEBRTC_REVISION=branch-heads/5735 npm run build
```

## Examples
or on PowerShell:

See [node-webrtc/node-webrtc-examples](https://github.com/node-webrtc/node-webrtc-examples).
```powershell
$env:WEBRTC_REVISION="branch-heads/5735"
npm run build
```

## Supported Platforms

The following platforms are confirmed to work with node-webrtc and have
prebuilt binaries available. Since node-webrtc targets [N-API version
3](https://nodejs.org/api/n-api.html), there may be additional platforms
supported that are not listed here. If your platform is not supported, you may
still be able to [build from source](docs/build-from-source.md).

<table>
<thead>
<tr>
<td colspan="2" rowspan="2"></td>
<th colspan="2">Linux</th>
<th colspan="2">macOS</th>
<th>Windows</th>
</tr>
<tr>
<th>x64</th>
<th>arm64</th>
<th>x64</th>
<th>arm64</th>
<th>x64</th>
</tr>
</thead>
<tbody>
<tr>
<th rowspan="2">Node</th>
<th>20</th>
<td align="center">✓</td>
<td align="center">?</td>
<td align="center">✓</td>
<td align="center">✓</td>
<td align="center">✓</td>
</tr>
<tr>
<th>22</th>
<td align="center">✓</td>
<td align="center">?</td>
<td align="center">✓</td>
<td align="center">✓</td>
<td align="center">✓</td>
</tr>
</tbody>
</table>

## Examples

See [node-webrtc/node-webrtc-examples](https://github.com/node-webrtc/node-webrtc-examples).
121 changes: 60 additions & 61 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,68 +1,67 @@
{
"name": "@roamhq/wrtc",
"description": "Standards-compliant WebRTC implementation for Node",
"keywords": [
"webrtc",
"p2p",
"peer"
],
"version": "0.10.0",
"author": "Jack Duvall <theduvallj@gmail.com> (https://duvallj.pw)",
"homepage": "https://github.com/WonderInventions/node-webrtc",
"bugs": "https://github.com/WonderInventions/node-webrtc/issues",
"license": "BSD-2-Clause",
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/WonderInventions/node-webrtc.git"
},
"main": "lib/index.js",
"types": "types/index.d.ts",
"browser": "lib/browser.js",
"files": [
"AUTHORS",
"CHANGELOG.md",
"lib",
"types"
],
"optionalDependencies": {
"@roamhq/wrtc-darwin-arm64": "0.10.0",
"@roamhq/wrtc-darwin-x64": "0.10.0",
"@roamhq/wrtc-linux-arm64": "0.10.0",
"@roamhq/wrtc-linux-x64": "0.10.0",
"@roamhq/wrtc-win32-x64": "0.10.0",
"domexception": "^4.0.0"
},
"devDependencies": {
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.17.0",
"@fidm/x509": "^1.2.1",
"cmake-js": "^7.3.0",
"cross-env": "^5.1.4",
"eslint": "^9.17.0",
"eslint-config-prettier": "^9.1.0",
"globals": "^15.14.0",
"husky": "^9.1.7",
"lint-staged": "^15.2.11",
"node-addon-api": "^7.0.0",
"patch-package": "^8.0.0",
"prettier": "^3.4.2",
"recursive-copy": "^2.0.14",
"simple-peer": "~9.7.0",
"tape": "^5.6.1",
"temp": "^0.9.4"
},
{
"name": "@roamhq/wrtc",
"description": "Standards-compliant WebRTC implementation for Node",
"keywords": [
"webrtc",
"p2p",
"peer"
],
"version": "0.10.0",
"author": "Jack Duvall <theduvallj@gmail.com> (https://duvallj.pw)",
"homepage": "https://github.com/WonderInventions/node-webrtc",
"bugs": "https://github.com/WonderInventions/node-webrtc/issues",
"license": "BSD-2-Clause",
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/WonderInventions/node-webrtc.git"
},
"main": "lib/index.js",
"types": "types/index.d.ts",
"browser": "lib/browser.js",
"files": [
"AUTHORS",
"CHANGELOG.md",
"lib",
"types"
],
"optionalDependencies": {
"@roamhq/wrtc-darwin-arm64": "0.10.0",
"@roamhq/wrtc-darwin-x64": "0.10.0",
"@roamhq/wrtc-linux-arm64": "0.10.0",
"@roamhq/wrtc-linux-x64": "0.10.0",
"@roamhq/wrtc-win32-x64": "0.10.0",
"domexception": "^4.0.0"
},
"devDependencies": {
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.17.0",
"@fidm/x509": "^1.2.1",
"cmake-js": "^7.3.0",
"cross-env": "^5.1.4",
"eslint": "^9.17.0",
"eslint-config-prettier": "^9.1.0",
"globals": "^15.14.0",
"husky": "^9.1.7",
"lint-staged": "^15.2.11",
"node-addon-api": "^7.0.0",
"patch-package": "^8.0.0",
"prettier": "^3.4.2",
"recursive-copy": "^2.0.14",
"simple-peer": "~9.7.0",
"tape": "^5.6.1",
"temp": "^0.9.4"
},
"scripts": {
"patch": "patch-package --error-on-warn",
"build": "node scripts/build-from-source.js",
"make-prebuilt": "node scripts/make-prebuilt.js",
"install-example": "node scripts/install-example.js",
"lint": "eslint lib/*.js lib/**/*.js test/*.js test/**/*.js scripts/*.js",
"test": "node --expose-gc test/all.js",
"prepare": "husky"
"test": "node --expose-gc test/all.js"
},
"lint-staged": {
"*.js": "eslint --cache --fix",
"*.{js,css,md}": "prettier --write",
"*.{cc,h}": "clang-format -i"
}
}
"lint-staged": {
"*.js": "eslint --cache --fix",
"*.{js,css,md}": "prettier --write",
"*.{cc,h}": "clang-format -i"
}
}
Loading