node-datachannel 0.3.4 → 0.3.5
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 +39 -0
- package/.github/workflows/build-linux.yml +3 -3
- package/.github/workflows/build-mac-m1.yml +41 -0
- package/.github/workflows/build-mac.yml +1 -1
- package/.github/workflows/build-win.yml +2 -2
- package/CMakeLists.txt +4 -3
- package/README.md +13 -10
- package/lib/index.d.ts +8 -5
- package/package.json +1 -1
- package/src/peer-connection-wrapper.cpp +9 -4
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
name: Build - Linux-Arm64
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
push:
|
|
6
|
+
tags:
|
|
7
|
+
- v*
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build-linux-arm64:
|
|
14
|
+
runs-on: ubuntu-20.04
|
|
15
|
+
|
|
16
|
+
strategy:
|
|
17
|
+
matrix:
|
|
18
|
+
node-version: [12.x, 13.x, 14.x, 15.x, 16.x, 17.x]
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v2
|
|
21
|
+
- name: Prepare Cross Compile
|
|
22
|
+
run: |
|
|
23
|
+
sudo apt update
|
|
24
|
+
sudo apt install -y g++-aarch64-linux-gnu gcc-aarch64-linux-gnu
|
|
25
|
+
mkdir sysroot && cd sysroot
|
|
26
|
+
wget https://commondatastorage.googleapis.com/chrome-linux-sysroot/toolchain/953c2471bc7e71a788309f6c2d2003e8b703305d/debian_sid_arm64_sysroot.tar.xz
|
|
27
|
+
tar xf debian_sid_arm64_sysroot.tar.xz
|
|
28
|
+
echo "ARM64_SYSROOT=$(pwd)" >> $GITHUB_ENV
|
|
29
|
+
ls -l
|
|
30
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
31
|
+
uses: actions/setup-node@v1
|
|
32
|
+
with:
|
|
33
|
+
node-version: ${{ matrix.node-version }}
|
|
34
|
+
- name: Build & Upload
|
|
35
|
+
run: |
|
|
36
|
+
npm install --ignore-scripts
|
|
37
|
+
node_modules/.bin/prebuild --backend cmake-js --arch arm64 --upload -u ${{ secrets.GITHUB_TOKEN }} -- --CDCMAKE_TOOLCHAIN_FILE:FILEPATH=./cmake/toolchain/arm64.cmake
|
|
38
|
+
env:
|
|
39
|
+
CI: true
|
|
@@ -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]
|
|
17
|
+
node-version: [10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x, 17.x, 18.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]
|
|
43
|
+
node-version: [10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x, 17.x, 18.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]
|
|
71
|
+
node-version: [10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x, 17.x, 18.x]
|
|
72
72
|
steps:
|
|
73
73
|
- uses: actions/checkout@v2
|
|
74
74
|
- name: Prepare Cross Compile
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
name: Build - Mac M1
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
push:
|
|
6
|
+
tags:
|
|
7
|
+
- v*
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build-macos:
|
|
14
|
+
runs-on: macos-11
|
|
15
|
+
strategy:
|
|
16
|
+
matrix:
|
|
17
|
+
node-version: [ 16.x]
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v2
|
|
21
|
+
- name: Install OpenSSL
|
|
22
|
+
run: HOMEBREW_NO_INSTALL_CLEANUP=1 brew reinstall openssl@1.1
|
|
23
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
24
|
+
uses: actions/setup-node@v1
|
|
25
|
+
with:
|
|
26
|
+
node-version: ${{ matrix.node-version }}
|
|
27
|
+
architecture: x64
|
|
28
|
+
- name: Build
|
|
29
|
+
run: npm install --build-from-source
|
|
30
|
+
env:
|
|
31
|
+
CI: true
|
|
32
|
+
OPENSSL_ROOT_DIR: /usr/local/opt/openssl
|
|
33
|
+
OPENSSL_LIBRARIES: /usr/local/opt/openssl/lib
|
|
34
|
+
- name: Test
|
|
35
|
+
run: npm run test
|
|
36
|
+
env:
|
|
37
|
+
CI: true
|
|
38
|
+
- name: Upload
|
|
39
|
+
run: node_modules/.bin/prebuild --upload -u ${{ secrets.GITHUB_TOKEN }}
|
|
40
|
+
env:
|
|
41
|
+
CI: true
|
|
@@ -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]
|
|
17
|
+
node-version: [10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x, 17.x, 18.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]
|
|
45
|
+
node_version: [10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x, 17.x, 18.x]
|
|
46
46
|
node_arch:
|
|
47
47
|
- x86
|
|
48
48
|
steps:
|
package/CMakeLists.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
cmake_minimum_required(VERSION 3.15)
|
|
2
2
|
cmake_policy(SET CMP0091 NEW)
|
|
3
|
-
project(node_datachannel VERSION 0.3.
|
|
3
|
+
project(node_datachannel VERSION 0.3.5)
|
|
4
4
|
|
|
5
5
|
# Workaround for https://github.com/murat-dogan/node-datachannel/issues/65
|
|
6
6
|
if( NODE_RUNTIMEVERSION VERSION_GREATER_EQUAL "17.0.0")
|
|
@@ -33,7 +33,7 @@ include(FetchContent)
|
|
|
33
33
|
FetchContent_Declare(
|
|
34
34
|
libdatachannel
|
|
35
35
|
GIT_REPOSITORY https://github.com/paullouisageneau/libdatachannel.git
|
|
36
|
-
GIT_TAG "v0.17.
|
|
36
|
+
GIT_TAG "v0.17.9"
|
|
37
37
|
)
|
|
38
38
|
|
|
39
39
|
option(NO_MEDIA "Disable media transport support in libdatachannel" OFF)
|
|
@@ -81,7 +81,8 @@ set(LINK_LIBRARIES
|
|
|
81
81
|
)
|
|
82
82
|
|
|
83
83
|
if(APPLE)
|
|
84
|
-
|
|
84
|
+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -arch x86_64 -arch arm64 ")
|
|
85
|
+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_LINK_FLAGS} -arch x86_64 -arch arm64 ")
|
|
85
86
|
elseif(UNIX)
|
|
86
87
|
list(APPEND LINK_LIBRARIES -static-libgcc -static-libstdc++)
|
|
87
88
|
endif()
|
package/README.md
CHANGED
|
@@ -20,16 +20,19 @@ npm install node-datachannel
|
|
|
20
20
|
|
|
21
21
|
## Supported Platforms
|
|
22
22
|
|
|
23
|
-
| | Linux-x64 | Linux-armv7 | Linux-arm64
|
|
24
|
-
|
|
25
|
-
| Node V10 | + | + | +
|
|
26
|
-
| Node V11 | + | + | +
|
|
27
|
-
| Node V12 | + | + | +
|
|
28
|
-
| Node V13 | + | + | +
|
|
29
|
-
| Node V14 | + | + | +
|
|
30
|
-
| Node V15 | + | + | +
|
|
31
|
-
| Node V16 | + | + | +
|
|
32
|
-
| Node V17 | + | + | +
|
|
23
|
+
| | Linux-x64 | Linux-armv7 | Linux-arm64(1) | Windows-x86 | Windows-x64 | Mac |
|
|
24
|
+
|----------|:---------:|:-----------:|:----------------:|:-----------:|:-----------:|:---:|
|
|
25
|
+
| Node V10 | + | + | + | + | + | + |
|
|
26
|
+
| Node V11 | + | + | + | + | + | + |
|
|
27
|
+
| Node V12 | + | + | + | + | + | + |
|
|
28
|
+
| Node V13 | + | + | + | + | + | + |
|
|
29
|
+
| Node V14 | + | + | + | + | + | + |
|
|
30
|
+
| Node V15 | + | + | + | + | + | + |
|
|
31
|
+
| Node V16 | + | + | + | + | + | + |
|
|
32
|
+
| Node V17 | + | + | + | + | + | + |
|
|
33
|
+
|
|
34
|
+
1) Please note that; For arm64 platform we need OpenSSL to be installed locally.
|
|
35
|
+
|
|
33
36
|
|
|
34
37
|
## Example Usage
|
|
35
38
|
|
package/lib/index.d.ts
CHANGED
|
@@ -50,6 +50,8 @@ export interface RtcConfig {
|
|
|
50
50
|
iceServers: (string | IceServer)[];
|
|
51
51
|
proxyServer?: ProxyServer;
|
|
52
52
|
enableIceTcp?: boolean;
|
|
53
|
+
enableIceUdpMux?: boolean;
|
|
54
|
+
disableAutoNegotiation?: boolean;
|
|
53
55
|
portRangeBegin?: number;
|
|
54
56
|
portRangeEnd?: number;
|
|
55
57
|
maxMessageSize?: number;
|
|
@@ -57,12 +59,13 @@ export interface RtcConfig {
|
|
|
57
59
|
iceTransportPolicy?: TransportPolicy;
|
|
58
60
|
}
|
|
59
61
|
|
|
62
|
+
// Lowercase to match the description type string from libdatachannel
|
|
60
63
|
export const enum DescriptionType {
|
|
61
|
-
Unspec = '
|
|
62
|
-
Offer = '
|
|
63
|
-
Answer = '
|
|
64
|
-
Pranswer = '
|
|
65
|
-
Rollback = '
|
|
64
|
+
Unspec = 'unspec',
|
|
65
|
+
Offer = 'offer',
|
|
66
|
+
Answer = 'answer',
|
|
67
|
+
Pranswer = 'pranswer',
|
|
68
|
+
Rollback = 'rollback',
|
|
66
69
|
}
|
|
67
70
|
|
|
68
71
|
export const enum ReliabilityType {
|
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
#include "media-video-wrapper.h"
|
|
5
5
|
#include "media-audio-wrapper.h"
|
|
6
6
|
|
|
7
|
+
#include <cctype>
|
|
7
8
|
#include <sstream>
|
|
8
9
|
|
|
9
10
|
Napi::FunctionReference PeerConnectionWrapper::constructor;
|
|
@@ -281,13 +282,17 @@ void PeerConnectionWrapper::setLocalDescription(const Napi::CallbackInfo &info)
|
|
|
281
282
|
}
|
|
282
283
|
std::string typeStr = info[0].As<Napi::String>().ToString();
|
|
283
284
|
|
|
284
|
-
|
|
285
|
+
// Accept uppercase first letter for backward compatibility
|
|
286
|
+
if(typeStr.size() > 0)
|
|
287
|
+
typeStr[0] = std::tolower(typeStr[0]);
|
|
288
|
+
|
|
289
|
+
if (typeStr == "answer")
|
|
285
290
|
type = rtc::Description::Type::Answer;
|
|
286
|
-
if (typeStr == "
|
|
291
|
+
else if (typeStr == "offer")
|
|
287
292
|
type = rtc::Description::Type::Offer;
|
|
288
|
-
if (typeStr == "
|
|
293
|
+
else if (typeStr == "pranswer")
|
|
289
294
|
type = rtc::Description::Type::Pranswer;
|
|
290
|
-
if (typeStr == "
|
|
295
|
+
else if (typeStr == "rollback")
|
|
291
296
|
type = rtc::Description::Type::Rollback;
|
|
292
297
|
}
|
|
293
298
|
|