node-datachannel 0.4.1 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/build-linux.yml +23 -23
- package/.github/workflows/build-mac-m1.yml +3 -3
- package/.github/workflows/build-mac-x64.yml +2 -2
- package/.github/workflows/build-win.yml +2 -2
- package/CMakeLists.txt +9 -3
- package/README.md +3 -1
- package/lib/index.d.ts +1 -0
- package/package.json +2 -2
- package/src/peer-connection-wrapper.cpp +6 -2
- package/.github/workflows/build-linux-arm64-test.yml +0 -36
|
@@ -14,7 +14,7 @@ jobs:
|
|
|
14
14
|
runs-on: ubuntu-20.04
|
|
15
15
|
strategy:
|
|
16
16
|
matrix:
|
|
17
|
-
node-version: [10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x, 17.x, 18.x, 19.x]
|
|
17
|
+
node-version: [10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x, 17.x, 18.x, 19.x, 20.x]
|
|
18
18
|
|
|
19
19
|
steps:
|
|
20
20
|
- uses: actions/checkout@v2
|
|
@@ -40,7 +40,7 @@ jobs:
|
|
|
40
40
|
|
|
41
41
|
strategy:
|
|
42
42
|
matrix:
|
|
43
|
-
node-version: [10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x, 17.x, 18.x, 19.x]
|
|
43
|
+
node-version: [10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x, 17.x, 18.x, 19.x, 20.x]
|
|
44
44
|
steps:
|
|
45
45
|
- uses: actions/checkout@v2
|
|
46
46
|
- name: Prepare Cross Compile
|
|
@@ -48,7 +48,7 @@ jobs:
|
|
|
48
48
|
sudo apt update
|
|
49
49
|
sudo apt install -y g++-arm-linux-gnueabihf gcc-arm-linux-gnueabihf
|
|
50
50
|
mkdir sysroot && cd sysroot
|
|
51
|
-
wget https://commondatastorage.googleapis.com/chrome-linux-sysroot/toolchain/ef5c4f84bcafb7a3796d36bb1db7826317dde51c/debian_sid_arm_sysroot.tar.xz
|
|
51
|
+
wget https://commondatastorage.googleapis.com/chrome-linux-sysroot/toolchain/ef5c4f84bcafb7a3796d36bb1db7826317dde51c/debian_sid_arm_sysroot.tar.xz
|
|
52
52
|
tar xf debian_sid_arm_sysroot.tar.xz
|
|
53
53
|
echo "ARM_SYSROOT=$(pwd)" >> $GITHUB_ENV
|
|
54
54
|
ls -l
|
|
@@ -68,7 +68,7 @@ jobs:
|
|
|
68
68
|
|
|
69
69
|
strategy:
|
|
70
70
|
matrix:
|
|
71
|
-
node-version: [10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x, 17.x, 18.x, 19.x]
|
|
71
|
+
node-version: [10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x, 17.x, 18.x, 19.x, 20.x]
|
|
72
72
|
steps:
|
|
73
73
|
- uses: actions/checkout@v2
|
|
74
74
|
- name: Prepare Cross Compile
|
|
@@ -76,7 +76,7 @@ jobs:
|
|
|
76
76
|
sudo apt update
|
|
77
77
|
sudo apt install -y g++-aarch64-linux-gnu gcc-aarch64-linux-gnu
|
|
78
78
|
mkdir sysroot && cd sysroot
|
|
79
|
-
wget https://commondatastorage.googleapis.com/chrome-linux-sysroot/toolchain/953c2471bc7e71a788309f6c2d2003e8b703305d/debian_sid_arm64_sysroot.tar.xz
|
|
79
|
+
wget https://commondatastorage.googleapis.com/chrome-linux-sysroot/toolchain/953c2471bc7e71a788309f6c2d2003e8b703305d/debian_sid_arm64_sysroot.tar.xz
|
|
80
80
|
tar xf debian_sid_arm64_sysroot.tar.xz
|
|
81
81
|
echo "ARM64_SYSROOT=$(pwd)" >> $GITHUB_ENV
|
|
82
82
|
ls -l
|
|
@@ -91,21 +91,21 @@ jobs:
|
|
|
91
91
|
env:
|
|
92
92
|
CI: true
|
|
93
93
|
|
|
94
|
-
npm-publish:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
94
|
+
# npm-publish:
|
|
95
|
+
# needs: [build-linux, build-linux-armv7, build-linux-arm64]
|
|
96
|
+
# name: npm-publish
|
|
97
|
+
# runs-on: ubuntu-latest
|
|
98
|
+
# steps:
|
|
99
|
+
# - name: Checkout repository
|
|
100
|
+
# uses: actions/checkout@v2
|
|
101
|
+
# - name: Set up Node.js
|
|
102
|
+
# uses: actions/setup-node@v1
|
|
103
|
+
# with:
|
|
104
|
+
# node-version: 12.x
|
|
105
|
+
# registry-url: "https://registry.npmjs.org"
|
|
106
|
+
# - name: Publish
|
|
107
|
+
# run: |
|
|
108
|
+
# npm install
|
|
109
|
+
# npm publish
|
|
110
|
+
# env:
|
|
111
|
+
# NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
|
|
@@ -11,10 +11,10 @@ env:
|
|
|
11
11
|
|
|
12
12
|
jobs:
|
|
13
13
|
build-macos:
|
|
14
|
-
runs-on: macos-
|
|
14
|
+
runs-on: macos-11
|
|
15
15
|
strategy:
|
|
16
16
|
matrix:
|
|
17
|
-
node-version: [10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x, 17.x, 18.x, 19.x]
|
|
17
|
+
node-version: [10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x, 17.x, 18.x, 19.x, 20.x]
|
|
18
18
|
|
|
19
19
|
steps:
|
|
20
20
|
- uses: actions/checkout@v3
|
|
@@ -34,4 +34,4 @@ jobs:
|
|
|
34
34
|
env:
|
|
35
35
|
CI: true
|
|
36
36
|
OPENSSL_ROOT_DIR: /tmp/opt/R/arm64
|
|
37
|
-
OPENSSL_LIBRARIES: /tmp/opt/R/arm64/lib
|
|
37
|
+
OPENSSL_LIBRARIES: /tmp/opt/R/arm64/lib
|
|
@@ -11,10 +11,10 @@ env:
|
|
|
11
11
|
|
|
12
12
|
jobs:
|
|
13
13
|
build-macos:
|
|
14
|
-
runs-on: macos-
|
|
14
|
+
runs-on: macos-11
|
|
15
15
|
strategy:
|
|
16
16
|
matrix:
|
|
17
|
-
node-version: [10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x, 17.x, 18.x, 19.x]
|
|
17
|
+
node-version: [10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x, 17.x, 18.x, 19.x, 20.x]
|
|
18
18
|
|
|
19
19
|
steps:
|
|
20
20
|
- uses: actions/checkout@v2
|
|
@@ -14,7 +14,7 @@ jobs:
|
|
|
14
14
|
runs-on: windows-2019
|
|
15
15
|
strategy:
|
|
16
16
|
matrix:
|
|
17
|
-
node-version: [10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x, 17.x, 18.x, 19.x]
|
|
17
|
+
node-version: [10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x, 17.x, 18.x, 19.x, 20.x]
|
|
18
18
|
|
|
19
19
|
steps:
|
|
20
20
|
- uses: actions/checkout@v2
|
|
@@ -42,7 +42,7 @@ jobs:
|
|
|
42
42
|
runs-on: windows-2019
|
|
43
43
|
strategy:
|
|
44
44
|
matrix:
|
|
45
|
-
node_version: [10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x, 17.x, 18.x, 19.x]
|
|
45
|
+
node_version: [10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x, 17.x, 18.x, 19.x, 20.x]
|
|
46
46
|
node_arch:
|
|
47
47
|
- x86
|
|
48
48
|
steps:
|
package/CMakeLists.txt
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
cmake_minimum_required(VERSION 3.15)
|
|
2
2
|
cmake_policy(SET CMP0091 NEW)
|
|
3
|
-
project(node_datachannel VERSION 0.4.
|
|
3
|
+
project(node_datachannel VERSION 0.4.3)
|
|
4
4
|
|
|
5
5
|
# Workaround for https://github.com/murat-dogan/node-datachannel/issues/65
|
|
6
|
-
if( NODE_RUNTIMEVERSION
|
|
6
|
+
if( NODE_RUNTIMEVERSION VERSION_GREATER "17.0.0" AND NODE_RUNTIMEVERSION VERSION_LESS "18.0.0" )
|
|
7
7
|
add_compile_definitions(OPENSSL_API_COMPAT=0x10100001L)
|
|
8
8
|
add_compile_definitions(OPENSSL_CONFIGURED_API=0x30000000L)
|
|
9
9
|
endif()
|
|
@@ -17,6 +17,10 @@ if(WIN32)
|
|
|
17
17
|
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
|
18
18
|
endif()
|
|
19
19
|
|
|
20
|
+
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android")
|
|
21
|
+
set(CMAKE_C_FLAGS "-Wno-error=unused-but-set-variable -Wno-error=strict-prototypes")
|
|
22
|
+
endif()
|
|
23
|
+
|
|
20
24
|
# Got linker error for arm64
|
|
21
25
|
# /usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: ../sysroot/usr/lib/aarch64-linux-gnu/libcrypto.a(sha1-armv8.o): relocation R_AARCH64_PREL64 against symbol `OPENSSL_armcap_P' which may bind externally can not be used when making a shared object; recompile with -fPIC
|
|
22
26
|
# ../sysroot/usr/lib/aarch64-linux-gnu/libcrypto.a(sha1-armv8.o): in function `sha1_block_armv8':
|
|
@@ -33,7 +37,7 @@ include(FetchContent)
|
|
|
33
37
|
FetchContent_Declare(
|
|
34
38
|
libdatachannel
|
|
35
39
|
GIT_REPOSITORY https://github.com/paullouisageneau/libdatachannel.git
|
|
36
|
-
GIT_TAG "v0.18.
|
|
40
|
+
GIT_TAG "v0.18.5"
|
|
37
41
|
)
|
|
38
42
|
|
|
39
43
|
option(NO_MEDIA "Disable media transport support in libdatachannel" OFF)
|
|
@@ -85,6 +89,8 @@ set(LINK_LIBRARIES
|
|
|
85
89
|
|
|
86
90
|
if(APPLE)
|
|
87
91
|
#
|
|
92
|
+
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android")
|
|
93
|
+
list(APPEND LINK_LIBRARIES -static-libgcc)
|
|
88
94
|
elseif(UNIX)
|
|
89
95
|
list(APPEND LINK_LIBRARIES -static-libgcc -static-libstdc++)
|
|
90
96
|
endif()
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Easy to use WebRTC data channels and media transport
|
|
2
2
|
|
|
3
|
-
   
|
|
4
4
|
|
|
5
5
|
- Easy to use
|
|
6
6
|
- Lightweight
|
|
@@ -31,6 +31,8 @@ npm install node-datachannel
|
|
|
31
31
|
| Node V16 | + | + | + | + | + | + |
|
|
32
32
|
| Node V17 | + | + | + | + | + | + |
|
|
33
33
|
| Node V18 | + | + | + | + | + | + |
|
|
34
|
+
| Node V19 | + | + | + | + | + | + |
|
|
35
|
+
| Node V20 | + | + | + | + | + | + |
|
|
34
36
|
|
|
35
37
|
1) Please note that; For Linux-arm64 platform we need OpenSSL to be installed locally.
|
|
36
38
|
|
package/lib/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-datachannel",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "libdatachannel node bindings",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"_from": "node-datachannel@latest",
|
|
12
12
|
"scripts": {
|
|
13
|
-
"install": "prebuild-install || (npm install --ignore-scripts && npm run _prebuild)",
|
|
13
|
+
"install": "prebuild-install || (npm install --ignore-scripts --production=false && npm run _prebuild)",
|
|
14
14
|
"install-nice": "npm run clean && cmake-js build --CDUSE_NICE=1",
|
|
15
15
|
"build": "cmake-js build",
|
|
16
16
|
"build:debug": "cmake-js build -D",
|
|
@@ -193,6 +193,10 @@ PeerConnectionWrapper::PeerConnectionWrapper(const Napi::CallbackInfo &info) : N
|
|
|
193
193
|
if (config.Get("disableAutoNegotiation").IsBoolean())
|
|
194
194
|
rtcConfig.disableAutoNegotiation = config.Get("disableAutoNegotiation").As<Napi::Boolean>();
|
|
195
195
|
|
|
196
|
+
// forceMediaTransport option
|
|
197
|
+
if (config.Get("forceMediaTransport").IsBoolean())
|
|
198
|
+
rtcConfig.forceMediaTransport = config.Get("forceMediaTransport").As<Napi::Boolean>();
|
|
199
|
+
|
|
196
200
|
// Max Message Size
|
|
197
201
|
if (config.Get("maxMessageSize").IsNumber())
|
|
198
202
|
rtcConfig.maxMessageSize = config.Get("maxMessageSize").As<Napi::Number>().Int32Value();
|
|
@@ -517,10 +521,10 @@ Napi::Value PeerConnectionWrapper::createDataChannel(const Napi::CallbackInfo &i
|
|
|
517
521
|
switch (reliability.Get("type").As<Napi::Number>().Uint32Value())
|
|
518
522
|
{
|
|
519
523
|
case 1:
|
|
520
|
-
init.reliability.rexmit = reliability.Get("rexmit").As<Napi::Number>();
|
|
524
|
+
init.reliability.rexmit = static_cast<int>(reliability.Get("rexmit").As<Napi::Number>().ToNumber());
|
|
521
525
|
break;
|
|
522
526
|
case 2:
|
|
523
|
-
init.reliability.rexmit = std::chrono::milliseconds(reliability.Get("rexmit").As<Napi::Number>());
|
|
527
|
+
init.reliability.rexmit = std::chrono::milliseconds(reliability.Get("rexmit").As<Napi::Number>().Uint32Value());
|
|
524
528
|
break;
|
|
525
529
|
}
|
|
526
530
|
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
name: Build - Linux-Arm64
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
workflow_dispatch:
|
|
5
|
-
|
|
6
|
-
env:
|
|
7
|
-
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
build-linux-arm64:
|
|
11
|
-
runs-on: ubuntu-20.04
|
|
12
|
-
|
|
13
|
-
strategy:
|
|
14
|
-
matrix:
|
|
15
|
-
node-version: [12.x, 13.x, 14.x, 15.x, 16.x, 17.x, 18.x, 19.x]
|
|
16
|
-
steps:
|
|
17
|
-
- uses: actions/checkout@v2
|
|
18
|
-
- name: Prepare Cross Compile
|
|
19
|
-
run: |
|
|
20
|
-
sudo apt update
|
|
21
|
-
sudo apt install -y g++-aarch64-linux-gnu gcc-aarch64-linux-gnu
|
|
22
|
-
mkdir sysroot && cd sysroot
|
|
23
|
-
wget https://commondatastorage.googleapis.com/chrome-linux-sysroot/toolchain/953c2471bc7e71a788309f6c2d2003e8b703305d/debian_sid_arm64_sysroot.tar.xz
|
|
24
|
-
tar xf debian_sid_arm64_sysroot.tar.xz
|
|
25
|
-
echo "ARM64_SYSROOT=$(pwd)" >> $GITHUB_ENV
|
|
26
|
-
ls -l
|
|
27
|
-
- name: Use Node.js ${{ matrix.node-version }}
|
|
28
|
-
uses: actions/setup-node@v1
|
|
29
|
-
with:
|
|
30
|
-
node-version: ${{ matrix.node-version }}
|
|
31
|
-
- name: Build & Upload
|
|
32
|
-
run: |
|
|
33
|
-
npm install --ignore-scripts
|
|
34
|
-
node_modules/.bin/prebuild --backend cmake-js --arch arm64 --upload -u ${{ secrets.GITHUB_TOKEN }} -- --CDCMAKE_TOOLCHAIN_FILE:FILEPATH=./cmake/toolchain/arm64.cmake
|
|
35
|
-
env:
|
|
36
|
-
CI: true
|