node-datachannel 0.4.0 → 0.4.2
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-arm64-test.yml +1 -1
- package/.github/workflows/build-linux.yml +3 -3
- package/.github/workflows/build-mac-m1.yml +3 -3
- package/.github/workflows/build-mac-x64.yml +2 -2
- package/.github/workflows/build-win.yml +3 -3
- package/API.md +1 -0
- package/CMakeLists.txt +15 -14
- package/LICENSE +373 -504
- package/README.md +1 -0
- package/lib/index.d.ts +3 -1
- package/package.json +3 -3
- package/src/data-channel-wrapper.cpp +1 -1
- package/src/peer-connection-wrapper.cpp +8 -4
- package/src/rtc-wrapper.cpp +38 -1
- package/src/rtc-wrapper.h +4 -0
- package/test/connectivity.js +1 -0
|
@@ -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]
|
|
17
|
+
node-version: [10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x, 17.x, 18.x, 19.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]
|
|
43
|
+
node-version: [10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x, 17.x, 18.x, 19.x]
|
|
44
44
|
steps:
|
|
45
45
|
- uses: actions/checkout@v2
|
|
46
46
|
- name: Prepare Cross Compile
|
|
@@ -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]
|
|
71
|
+
node-version: [10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x, 17.x, 18.x, 19.x]
|
|
72
72
|
steps:
|
|
73
73
|
- uses: actions/checkout@v2
|
|
74
74
|
- name: Prepare Cross Compile
|
|
@@ -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]
|
|
17
|
+
node-version: [10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x, 17.x, 18.x, 19.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]
|
|
17
|
+
node-version: [10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x, 17.x, 18.x, 19.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]
|
|
17
|
+
node-version: [10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x, 17.x, 18.x, 19.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]
|
|
45
|
+
node_version: [10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x, 17.x, 18.x, 19.x]
|
|
46
46
|
node_arch:
|
|
47
47
|
- x86
|
|
48
48
|
steps:
|
|
@@ -52,7 +52,7 @@ jobs:
|
|
|
52
52
|
arch: x86
|
|
53
53
|
- name: Install OpenSSL
|
|
54
54
|
run: choco install openssl --x86=true
|
|
55
|
-
- name: Use Node.js ${{ matrix.
|
|
55
|
+
- name: Use Node.js ${{ matrix.node_version }}
|
|
56
56
|
uses: aminya/setup-node@x86
|
|
57
57
|
with:
|
|
58
58
|
node-version: ${{ matrix.node_version }}
|
package/API.md
CHANGED
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.2)
|
|
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,18 +17,17 @@ if(WIN32)
|
|
|
17
17
|
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
|
18
18
|
endif()
|
|
19
19
|
|
|
20
|
-
if(
|
|
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
|
+
|
|
24
|
+
# Got linker error for arm64
|
|
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
|
|
26
|
+
# ../sysroot/usr/lib/aarch64-linux-gnu/libcrypto.a(sha1-armv8.o): in function `sha1_block_armv8':
|
|
27
|
+
# (.text+0x1240): dangerous relocation: unsupported relocation
|
|
28
|
+
if(NOT ${NODE_ARCH} STREQUAL "arm64")
|
|
21
29
|
set(OPENSSL_USE_STATIC_LIBS TRUE)
|
|
22
30
|
find_package(OpenSSL REQUIRED)
|
|
23
|
-
elseif(UNIX)
|
|
24
|
-
# Got linker error for arm64
|
|
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
|
|
26
|
-
# ../sysroot/usr/lib/aarch64-linux-gnu/libcrypto.a(sha1-armv8.o): in function `sha1_block_armv8':
|
|
27
|
-
# (.text+0x1240): dangerous relocation: unsupported relocation
|
|
28
|
-
if(NOT ${NODE_ARCH} STREQUAL "arm64")
|
|
29
|
-
set(OPENSSL_USE_STATIC_LIBS TRUE)
|
|
30
|
-
find_package(OpenSSL REQUIRED)
|
|
31
|
-
endif()
|
|
32
31
|
endif()
|
|
33
32
|
|
|
34
33
|
|
|
@@ -38,7 +37,7 @@ include(FetchContent)
|
|
|
38
37
|
FetchContent_Declare(
|
|
39
38
|
libdatachannel
|
|
40
39
|
GIT_REPOSITORY https://github.com/paullouisageneau/libdatachannel.git
|
|
41
|
-
GIT_TAG "v0.
|
|
40
|
+
GIT_TAG "v0.18.2"
|
|
42
41
|
)
|
|
43
42
|
|
|
44
43
|
option(NO_MEDIA "Disable media transport support in libdatachannel" OFF)
|
|
@@ -76,7 +75,7 @@ target_include_directories(${PROJECT_NAME} PRIVATE
|
|
|
76
75
|
if( NODE_RUNTIMEVERSION VERSION_LESS "16.0.0")
|
|
77
76
|
# For compatibility with Node.js 12
|
|
78
77
|
# This should be removed along with the napi-thread-safe-callback-cancellable dependency when dropping support at end-of-life
|
|
79
|
-
target_compile_definitions(${PROJECT_NAME} PRIVATE -DLEGACY_NAPI_THREAD_SAFE_CALLBACK)
|
|
78
|
+
target_compile_definitions(${PROJECT_NAME} PRIVATE -DLEGACY_NAPI_THREAD_SAFE_CALLBACK)
|
|
80
79
|
endif()
|
|
81
80
|
|
|
82
81
|
target_include_directories(${PROJECT_NAME} PRIVATE
|
|
@@ -90,6 +89,8 @@ set(LINK_LIBRARIES
|
|
|
90
89
|
|
|
91
90
|
if(APPLE)
|
|
92
91
|
#
|
|
92
|
+
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android")
|
|
93
|
+
list(APPEND LINK_LIBRARIES -static-libgcc)
|
|
93
94
|
elseif(UNIX)
|
|
94
95
|
list(APPEND LINK_LIBRARIES -static-libgcc -static-libstdc++)
|
|
95
96
|
endif()
|