node-datachannel
Advanced tools
Comparing version 0.10.0 to 0.10.1
@@ -5,3 +5,3 @@ cmake_minimum_required(VERSION 3.15) | ||
project(node_datachannel VERSION 0.10.0) | ||
project(node_datachannel VERSION 0.10.1) | ||
@@ -33,3 +33,3 @@ # -Dnapi_build_version=8 | ||
GIT_REPOSITORY https://github.com/paullouisageneau/libdatachannel.git | ||
GIT_TAG "v0.21.1" | ||
GIT_TAG "v0.21.2" | ||
) | ||
@@ -36,0 +36,0 @@ |
{ | ||
"name": "node-datachannel", | ||
"version": "0.10.0", | ||
"version": "0.10.1", | ||
"description": "libdatachannel node bindings", | ||
@@ -5,0 +5,0 @@ "type": "module", |
# WebRTC Polyfills | ||
> This part is ongoing work and is considered to be in beta phase. | ||
> Any feedback and contributions are welcomed. | ||
WebRTC polyfills to be used for libraries like `simple-peer`. | ||
@@ -8,0 +4,0 @@ |
@@ -1,15 +0,12 @@ | ||
# Easy to use WebRTC data channels and media transport | ||
# WebRTC For Node.js and Electron | ||
![Linux CI Build](https://github.com/murat-dogan/node-datachannel/workflows/Build%20-%20Linux/badge.svg) ![Windows CI Build](https://github.com/murat-dogan/node-datachannel/workflows/Build%20-%20Win/badge.svg) ![Mac x64 CI Build](https://github.com/murat-dogan/node-datachannel/workflows/Build%20-%20Mac%20x64/badge.svg) ![Mac M1 CI Build](https://github.com/murat-dogan/node-datachannel/workflows/Build%20-%20Mac%20M1/badge.svg) | ||
- Easy to use | ||
- Lightweight | ||
- No need to deal with WebRTC stack! | ||
- Small binary sizes | ||
- Small binary sizes (~8MB for Linux X64) | ||
- Type infos for Typescript | ||
This project is NodeJS bindings for [libdatachannel](https://github.com/paullouisageneau/libdatachannel) library. | ||
This project is Node.js bindings for [libdatachannel](https://github.com/paullouisageneau/libdatachannel) library. | ||
Please check [libdatachannel](https://github.com/paullouisageneau/libdatachannel) for Compatibility & WebRTC details. | ||
## Install | ||
@@ -23,7 +20,7 @@ | ||
`node-datachannel` targets N-API version 8 and supports NodeJS v16 and above. It is tested on Linux, Windows and MacOS. For N-API compatibility please check [here](https://nodejs.org/api/n-api.html#n_api_n_api_version_matrix). | ||
`node-datachannel` targets N-API version 8 and supports Node.js v16 and above. It is tested on Linux, Windows and MacOS. For N-API compatibility please check [here](https://nodejs.org/api/n-api.html#n_api_n_api_version_matrix). | ||
| | Linux [x64,armv7,arm64] (1) | Windows [x86,x64] | Mac [M1,x64] | | ||
| ----------------------- | :-------------------------: | :---------------: | :----------: | | ||
| NAPI V8 (>= NodeJS V16) | + | + | + | | ||
| | Linux [x64,armv7,arm64] (1) | Windows [x86,x64] | Mac [M1,x64] | | ||
| ------------------------- | :-------------------------: | :---------------: | :----------: | | ||
| N-API v8 (>= Node.js v16) | + | + | + | | ||
@@ -38,2 +35,8 @@ **(1)** For Linux musl + libc | ||
## WebRTC Polyfills | ||
WebRTC polyfills to be used for libraries like `simple-peer`. | ||
Please check [here](/polyfill) | ||
## Example Usage | ||
@@ -52,9 +55,6 @@ | ||
// Set Callbacks | ||
peer1.onLocalDescription((sdp, type) => { | ||
console.log('Peer1 SDP:', sdp, ' Type:', type); | ||
peer2.setRemoteDescription(sdp, type); | ||
}); | ||
peer1.onLocalCandidate((candidate, mid) => { | ||
console.log('Peer1 Candidate:', candidate); | ||
peer2.addRemoteCandidate(candidate, mid); | ||
@@ -65,13 +65,9 @@ }); | ||
// Set Callbacks | ||
peer2.onLocalDescription((sdp, type) => { | ||
console.log('Peer2 SDP:', sdp, ' Type:', type); | ||
peer1.setRemoteDescription(sdp, type); | ||
}); | ||
peer2.onLocalCandidate((candidate, mid) => { | ||
console.log('Peer2 Candidate:', candidate); | ||
peer1.addRemoteCandidate(candidate, mid); | ||
}); | ||
peer2.onDataChannel((dc) => { | ||
console.log('Peer2 Got DataChannel: ', dc.getLabel()); | ||
dc2 = dc; | ||
@@ -93,15 +89,7 @@ dc2.onMessage((msg) => { | ||
}); | ||
setTimeout(() => { | ||
dc1.close(); | ||
dc2.close(); | ||
peer1.close(); | ||
peer2.close(); | ||
nodeDataChannel.cleanup(); | ||
}, 10 * 1000); | ||
``` | ||
## WebRTC Polyfills | ||
## Examples | ||
Please check [here](/polyfill) | ||
Please check [examples](/examples/) folder | ||
@@ -119,6 +107,2 @@ ## Test | ||
## Examples | ||
Please check [examples](/examples/) folder | ||
## API Docs | ||
@@ -128,4 +112,8 @@ | ||
## Contributing | ||
Contributions welcome! | ||
## Thanks | ||
Thanks to [Streamr](https://streamr.network/) for supporting this project by being a Sponsor! |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1092911
113