mirror of
https://github.com/bdnugget/nbnet.git
synced 2026-11-07 05:27:27 +00:00
[WIP] Rework native webrtc driver (ditch facil.io) (#52)
Remove the dependency of the native webrtc driver to facil.io entirely.
This commit is contained in:
1 parent
ad2c3c3151
commit
a0d605e27f
27 files changed
+2795
-548
No files matched your search
+52
-28
@@ -62,7 +62,9 @@ jobs:
|
||||
- name: Compile soak test
|
||||
run: |
|
||||
cd soak
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug .
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug ..
|
||||
make
|
||||
- name: Run soak test
|
||||
run: timeout 240 ./bin/github-actions/run_soak.sh
|
||||
@@ -76,7 +78,9 @@ jobs:
|
||||
- name: Compile soak test
|
||||
run: |
|
||||
cd soak
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug -DCPP_COMPILE=ON .
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug -DCPP_COMPILE=ON ..
|
||||
make
|
||||
- name: Run soak test
|
||||
run: timeout 240 ./bin/github-actions/run_soak.sh
|
||||
@@ -97,22 +101,13 @@ jobs:
|
||||
cd net_drivers/webrtc
|
||||
npm install --build-from-resource
|
||||
- name: Compile soak test
|
||||
run: |
|
||||
cd emsdk
|
||||
source ./emsdk_env.sh
|
||||
cd ../soak
|
||||
mkdir build
|
||||
cd build
|
||||
emcmake cmake ..
|
||||
make
|
||||
cd ..
|
||||
npm install
|
||||
run: ./bin/github-actions/build_soak_web.sh
|
||||
- name: Run soak test
|
||||
run: |
|
||||
cd emsdk
|
||||
source ./emsdk_env.sh
|
||||
cd ..
|
||||
EMSCRIPTEN=1 timeout 240 ./bin/github-actions/run_soak.sh
|
||||
WEBRTC=1 timeout 240 ./bin/github-actions/run_soak.sh
|
||||
|
||||
soak-test-osx-c:
|
||||
runs-on: macos-latest
|
||||
@@ -123,7 +118,9 @@ jobs:
|
||||
- name: Compile soak test
|
||||
run: |
|
||||
cd soak
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug .
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug ..
|
||||
make
|
||||
- name: Run soak test
|
||||
run: gtimeout 240 ./bin/github-actions/run_soak.sh
|
||||
@@ -137,7 +134,9 @@ jobs:
|
||||
- name: Compile soak test
|
||||
run: |
|
||||
cd soak
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug -DCPP_COMPILE=ON .
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug -DCPP_COMPILE=ON ..
|
||||
make
|
||||
- name: Run soak test
|
||||
run: gtimeout 240 ./bin/github-actions/run_soak.sh
|
||||
@@ -158,23 +157,13 @@ jobs:
|
||||
cd net_drivers/webrtc
|
||||
npm install --build-from-resource
|
||||
- name: Compile soak test
|
||||
run: |
|
||||
cd emsdk
|
||||
source ./emsdk_env.sh
|
||||
cd ../soak
|
||||
mkdir build
|
||||
cd build
|
||||
emcmake cmake ..
|
||||
make
|
||||
cd ..
|
||||
npm install
|
||||
run: ./bin/github-actions/build_soak_web.sh
|
||||
- name: Run soak test
|
||||
run: |
|
||||
cd emsdk
|
||||
source ./emsdk_env.sh
|
||||
cd ..
|
||||
EMSCRIPTEN=1 gtimeout 240 ./bin/github-actions/run_soak.sh
|
||||
|
||||
WEBRTC=1 gtimeout 240 ./bin/github-actions/run_soak.sh
|
||||
|
||||
soak-test-windows-c:
|
||||
runs-on: windows-latest
|
||||
@@ -184,11 +173,46 @@ jobs:
|
||||
- name: Compile soak test
|
||||
run: |
|
||||
cd soak
|
||||
cmake -G "NMake Makefiles" .
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G "NMake Makefiles" ..
|
||||
nmake
|
||||
- name: Run soak test
|
||||
run: ./bin/github-actions/run_soak.sh
|
||||
|
||||
soak-test-linux-webrtc-native:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install prerequisites
|
||||
run: sudo apt-get install build-essential cmake git -y
|
||||
- name: Download and build libdatachannel
|
||||
run: ./bin/github-actions/download_and_build_libdatachannel.sh
|
||||
- name: Install emsdk
|
||||
run: ./bin/github-actions/install_emsdk.sh
|
||||
- name: Install nbnet NPM dependencies
|
||||
run: |
|
||||
npm update
|
||||
npm install -g node-pre-gyp
|
||||
npm install -g node-gyp
|
||||
cd net_drivers/webrtc
|
||||
npm install --build-from-resource
|
||||
- name: Compile soak test (native)
|
||||
run: |
|
||||
cd soak
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DLIBDATACHANNEL_LIBRARY_PATH=${{ github.workspace }}/libdatachannel/build/libdatachannel.so -DLIBDATACHANNEL_INCLUDE_PATH=${{ github.workspace }}/libdatachannel/include -DWEBRTC_NATIVE=ON ..
|
||||
make
|
||||
- name: Compile soak test (web)
|
||||
run: ./bin/github-actions/build_soak_web.sh
|
||||
- name: Run soak test
|
||||
run: |
|
||||
cd emsdk
|
||||
source ./emsdk_env.sh
|
||||
cd ..
|
||||
WEBRTC_NATIVE=1 timeout 240 ./bin/github-actions/run_soak.sh
|
||||
|
||||
compile-examples-linux-c:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
nbnet is a single header C (C99) library designed to implement client-server architecture, more precisely for online video games. The library is based on this [great series of articles](https://gafferongames.com/) by Glenn Fiedler.
|
||||
|
||||
nbnet can target different protocols such as UDP or WebRTC through "drivers" (see below for more information).
|
||||
nbnet can target different protocols such as UDP or [WebRTC](WEBRTC.md) through "drivers" (see below for more information).
|
||||
|
||||
The API is meant to be as straightforward as possible and relies on event polling, making it easy to integrate into a game loop.
|
||||
|
||||
@@ -41,7 +41,6 @@ nbnet encryption and packet authentication use the following open-source librari
|
||||
|
||||
the native WebRTC driver relies on:
|
||||
|
||||
- [facil.io](https://github.com/boazsegev/facil.io)
|
||||
- [libdatachannel](https://github.com/paullouisageneau/libdatachannel)
|
||||
- [json.h](https://github.com/sheredom/json.h)
|
||||
|
||||
@@ -125,106 +124,10 @@ For memory management, nbnet uses `malloc`, `realloc` and `free`. You can redefi
|
||||
#define NBN_Deallocator free
|
||||
```
|
||||
|
||||
All set, from here, I suggest you hop into the examples. If you are interested in using the WebRTC driver, read below.
|
||||
All set, from here, I suggest you hop into the examples. If you are interested in WebRTC, go [here](WEBRTC.md).
|
||||
|
||||
## Byte arrays
|
||||
|
||||
nbnet comes with a primitive bit-level serialization system; but, if you want to use your own serialization solution, nbnet lets you send and receive raw byte arrays.
|
||||
|
||||
See the [echo_bytes](https://github.com/nathhB/nbnet/tree/master/examples/echo_bytes) example.
|
||||
|
||||
## WebRTC
|
||||
|
||||
nbnet lets you implement web browser online games in C without writing any JS code.
|
||||
|
||||
To do that, you need to compile your code with *emscripten*. You can either use the
|
||||
`emcc` command directly or use CMake, the examples demonstrate how to use both.
|
||||
|
||||
The following emscripten options are mandatory and must always be added to your compilation command line or CMake script.
|
||||
|
||||
*emscripten* does not provide a C API for WebRTC, only a JS one. nbnet provides a wrapper around it so you don't have to write any JS code (oof!). All you have to is compile with:
|
||||
|
||||
`--js-library "net_drivers/webrtc/js/api.js"`
|
||||
|
||||
The nbnet JS API uses a bunch of asynchronous functions that you need to let *emscripten* know about:
|
||||
|
||||
`-s ASYNCIFY`
|
||||
|
||||
`-s ASYNCIFY_IMPORTS="[\"__js_game_client_start\", \"__js_game_client_close\", \"__js_game_server_start\\"]"`
|
||||
|
||||
nbnet network conditions simulation run in a separate thread so if you want to use it you need to compile with:
|
||||
|
||||
`-s USE_PTHREADS=1`
|
||||
|
||||
If you want to run your code in a web browser, you need to provide a shell file:
|
||||
|
||||
`--shell-file <PATH TO YOUR SHELL FILE>`
|
||||
|
||||
To learn about shell files: https://emscripten.org/docs/tools_reference/emcc.html
|
||||
|
||||
You can also look at the `shell.html` from the raylib example.
|
||||
|
||||
Apart from that, you probably want to add:
|
||||
|
||||
`-s ALLOW_MEMORY_GROWTH=1` and `-s EXIT_RUNTIME=1`
|
||||
|
||||
For more information: https://emscripten.org/docs/tools_reference/emcc.html
|
||||
|
||||
### Native WebRTC server
|
||||
|
||||
TODO.
|
||||
|
||||
Please refer to the [raylib example](https://github.com/nathhB/nbnet/tree/master/examples/raylib#native-webrtc-driver) for more information.
|
||||
|
||||
### NodeJS server
|
||||
|
||||
Most of the time, you want your server code to run in a *NodeJS* server. You can get *NodeJS* it from [here](https://nodejs.org/en/download/).
|
||||
|
||||
Once it's installed, you need to create a `package.json` file. Check out the *echo* and *raylib* examples to see what this file looks like. (For more information: https://docs.npmjs.com/creating-a-package-json-file)
|
||||
|
||||
To run your server, you need to install the required *NodeJS* packages by running:
|
||||
|
||||
`npm install`
|
||||
|
||||
from the directory containing your `package.json` file.
|
||||
|
||||
Then to run your server:
|
||||
|
||||
`node server.js`
|
||||
|
||||
`server.js` being the JS file generated by *emscripten*.
|
||||
|
||||
### Web browser
|
||||
|
||||
Unless your client is a non-graphical application, you want your client code to run in a web browser.
|
||||
|
||||
With the correct options *emscripten* will output an HTML file. From here, all you need to do is run an HTTP server that serves
|
||||
this file and open it in your web browser.
|
||||
|
||||
For testing purposes, I recommend using Python [SimpleHTTPServer](https://docs.python.org/2/library/simplehttpserver.html).
|
||||
|
||||
Just run:
|
||||
|
||||
`python -m SimpleHTTPServer 8000`
|
||||
|
||||
in the directory containing your HTML file; then, open `http://localhost:8000` in your web browser and open your client HTML file.
|
||||
|
||||
One significant difference between running JS code in a web browser compared to running it in *NodeJS* is that you cannot use the *NodeJS* packaging system. nbnet's WebRTC code relies on *NodeJS* packages, so, for nbnet to run in a web browser we need to "bundle" those packages into something that can be used by a web browser.
|
||||
|
||||
I recommend using [browserify](https://github.com/browserify/browserify).
|
||||
|
||||
To bundle packages with browserify, you need to first install the required *NodeJS* packages by running:
|
||||
|
||||
`npm install`
|
||||
|
||||
from the directory containing the same `package.json` file used by your server.
|
||||
|
||||
Then you can run:
|
||||
|
||||
`browserify net_drivers/webrtc/js/nbnet.js -o nbnet_bundle.js`
|
||||
|
||||
and include the generated `nbnet_bundle.js` script to your HTML shell file:
|
||||
|
||||
`<script src="nbnet_bundle.js"></script>`
|
||||
|
||||
See the *raylib* example to see this operation integrated into a CMake script.
|
||||
@@ -0,0 +1,94 @@
|
||||
# WebRTC
|
||||
|
||||
nbnet provides two different WebRTC drivers, WASM and native. The WASM driver has to be compiled with emscripten and can be used to target web browsers or Node JS. The native driver can be compiled as a native application.
|
||||
|
||||
If you want to build an online game that can run in a web browser, I recommend using the WASM driver for the client and the native driver for the server.
|
||||
|
||||
Please refer to the echo example for a concrete demonstration of how to use these two drivers.
|
||||
|
||||
## Building (WASM)
|
||||
|
||||
If you want to target WASM, you'll need to compile your code with *emscripten*. You can either use the `emcc` command directly or use CMake (refer to the examples to see how to set it up).
|
||||
|
||||
The following emscripten options are mandatory and must always be added to your compilation command line or CMake script.
|
||||
|
||||
*emscripten* does not provide a C API for WebRTC, only a JS one. nbnet provides a wrapper around it so you don't have to write any JS code (oof!). All you have to do is compile with:
|
||||
|
||||
`--js-library "net_drivers/webrtc/js/api.js"`
|
||||
|
||||
The nbnet JS API uses a bunch of asynchronous functions that you'll need to let *emscripten* know about:
|
||||
|
||||
`-s ASYNCIFY`
|
||||
|
||||
`-s ASYNCIFY_IMPORTS="[\"__js_game_client_start\", \"__js_game_client_close\", \"__js_game_server_start\\"]"`
|
||||
|
||||
nbnet network conditions simulation runs in a separate thread so if you want to use it you'll need to compile with:
|
||||
|
||||
`-s USE_PTHREADS=1`
|
||||
|
||||
If you want to run your code in a web browser, you'll also need to provide a shell file:
|
||||
|
||||
`--shell-file <PATH TO YOUR SHELL FILE>`
|
||||
|
||||
To learn more about shell files: https://emscripten.org/docs/tools_reference/emcc.html
|
||||
|
||||
You can also look at the `shell.html` from the raylib example.
|
||||
|
||||
For more information: https://emscripten.org/docs/tools_reference/emcc.html
|
||||
|
||||
## Building (Native)
|
||||
|
||||
The Native WebRTC driver depends on [libdatachannel](https://github.com/paullouisageneau/libdatachannel). Please follow the building instructions in the library repository.
|
||||
|
||||
## NodeJS
|
||||
|
||||
If you decide to go with WASM for your server, you'll need to run it in a *NodeJS* server. You can get *NodeJS* from [here](https://nodejs.org/en/download/).
|
||||
|
||||
Once it's installed, you'll need to create a `package.json` file. Check out the *echo* and *raylib* examples to see what this file should look like. (For more information: https://docs.npmjs.com/creating-a-package-json-file)
|
||||
|
||||
To run your server, you need to install the required *NodeJS* packages by running:
|
||||
|
||||
`npm install`
|
||||
|
||||
from the directory containing your `package.json` file.
|
||||
|
||||
Then to run your server:
|
||||
|
||||
`node server.js`
|
||||
|
||||
`server.js` is the JS file generated by *emscripten*.
|
||||
|
||||
## Web browser
|
||||
|
||||
Unless your client is a non-graphical application, you'll probably want your client to run in a web browser.
|
||||
|
||||
With the correct options *emscripten* will output an HTML file, from here, all you need to do is run an HTTP server that serves
|
||||
this file and open it in your web browser.
|
||||
|
||||
For testing purposes, I recommend using Python [SimpleHTTPServer](https://docs.python.org/2/library/simplehttpserver.html).
|
||||
|
||||
Just run:
|
||||
|
||||
`python -m SimpleHTTPServer 8000`
|
||||
|
||||
in the directory containing your HTML file; then, open `http://localhost:8000` in your web browser and open your client HTML file.
|
||||
|
||||
One significant difference between running JS code in a web browser compared to running it in *NodeJS* is that you cannot use the *NodeJS* packaging system. nbnet's WebRTC code relies on *NodeJS* packages, so, for nbnet to run in a web browser we need to "bundle" those packages into something that can be used by a web browser.
|
||||
|
||||
I recommend using [browserify](https://github.com/browserify/browserify).
|
||||
|
||||
To bundle packages with browserify, you need to first install the required *NodeJS* packages by running:
|
||||
|
||||
`npm install`
|
||||
|
||||
from the directory containing the same `package.json` file used by your server.
|
||||
|
||||
Then you can run:
|
||||
|
||||
`browserify net_drivers/webrtc/js/nbnet.js -o nbnet_bundle.js`
|
||||
|
||||
and include the generated `nbnet_bundle.js` script in your HTML shell file:
|
||||
|
||||
`<script src="nbnet_bundle.js"></script>`
|
||||
|
||||
See the *raylib* example to see how you can integrate this operation into a CMake script.
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd emsdk
|
||||
source ./emsdk_env.sh
|
||||
cd ../soak
|
||||
mkdir build_web
|
||||
cd build_web
|
||||
emcmake cmake ..
|
||||
make
|
||||
cd ..
|
||||
npm install
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
git clone https://github.com/paullouisageneau/libdatachannel.git
|
||||
cd libdatachannel
|
||||
git submodule update --init --recursive --depth 1
|
||||
cmake -B build -DUSE_GNUTLS=0 -DUSE_NICE=0 -DCMAKE_BUILD_TYPE=Release
|
||||
cd build
|
||||
make -j2
|
||||
@@ -8,14 +8,63 @@ CHANNEL_COUNT=3
|
||||
MESSAGE_COUNT=500
|
||||
NODE_CMD="$EMSDK_NODE --experimental-wasm-threads"
|
||||
|
||||
run_client () {
|
||||
node_client=$1
|
||||
echo "Running soak client (run in mode: $node_client)..."
|
||||
|
||||
if [ $node_client -eq 1 ]
|
||||
then
|
||||
# WASM WebRTC client
|
||||
$NODE_CMD build_web/client.js --message_count=$MESSAGE_COUNT --channel_count=$CHANNEL_COUNT --packet_loss=$PACKET_LOSS --packet_duplication=$PACKET_DUPLICATION --ping=$PING --jitter=$JITTER &> soak_cli_out
|
||||
elif [ $node_client -eq 2 ]
|
||||
then
|
||||
# native WebRTC client
|
||||
./build/client --webrtc --message_count=$MESSAGE_COUNT --channel_count=$CHANNEL_COUNT --packet_loss=$PACKET_LOSS --packet_duplication=$PACKET_DUPLICATION --ping=$PING --jitter=$JITTER &> soak_cli_out
|
||||
else
|
||||
# UDP client
|
||||
./build/client --message_count=$MESSAGE_COUNT --channel_count=$CHANNEL_COUNT --packet_loss=$PACKET_LOSS --packet_duplication=$PACKET_DUPLICATION --ping=$PING --jitter=$JITTER &> soak_cli_out
|
||||
fi
|
||||
|
||||
RESULT=$?
|
||||
|
||||
# when running the soak test in the latest version of emscripten with node 16
|
||||
# the client aborts at the end when calling emscripten_force_exit
|
||||
# I could not figure out why, hence the condition
|
||||
[[ $node_client -eq 1 ]] && EXPECTED_RESULT=7 || EXPECTED_RESULT=0
|
||||
|
||||
if [ $RESULT -eq $EXPECTED_RESULT ]
|
||||
then
|
||||
echo "Soak test completed with success!"
|
||||
echo "Printing the end of client logs..."
|
||||
|
||||
tail -n 150 soak_cli_out
|
||||
|
||||
return 0
|
||||
else
|
||||
echo "Soak test failed! (code: $RESULT)"
|
||||
echo "Printing the end of client logs..."
|
||||
tail -n 150 soak_cli_out
|
||||
echo "Printing the end of server logs..."
|
||||
tail -n 150 soak_serv_out
|
||||
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
exit_soak () {
|
||||
kill -SIGINT $SERV_PID 2> /dev/null
|
||||
|
||||
exit $1
|
||||
}
|
||||
|
||||
cd soak
|
||||
echo "Starting soak server..."
|
||||
|
||||
if [ -n "$EMSCRIPTEN" ]
|
||||
if [ -n "$WEBRTC" ]
|
||||
then
|
||||
$NODE_CMD build/server.js --channel_count=$CHANNEL_COUNT --packet_loss=$PACKET_LOSS --packet_duplication=$PACKET_DUPLICATION --ping=$PING --jitter=$JITTER &> soak_serv_out &
|
||||
$NODE_CMD build_web/server.js --channel_count=$CHANNEL_COUNT --packet_loss=$PACKET_LOSS --packet_duplication=$PACKET_DUPLICATION --ping=$PING --jitter=$JITTER &> soak_serv_out &
|
||||
else
|
||||
./server --channel_count=$CHANNEL_COUNT --packet_loss=$PACKET_LOSS --packet_duplication=$PACKET_DUPLICATION --ping=$PING --jitter=$JITTER &> soak_serv_out &
|
||||
./build/server --channel_count=$CHANNEL_COUNT --packet_loss=$PACKET_LOSS --packet_duplication=$PACKET_DUPLICATION --ping=$PING --jitter=$JITTER &> soak_serv_out &
|
||||
fi
|
||||
|
||||
if [ $? -eq 0 ]
|
||||
@@ -31,38 +80,20 @@ fi
|
||||
|
||||
sleep 3
|
||||
|
||||
if [ -n "$EMSCRIPTEN" ]
|
||||
if [ -n "$WEBRTC" ]
|
||||
then
|
||||
$NODE_CMD build/client.js --message_count=$MESSAGE_COUNT --channel_count=$CHANNEL_COUNT --packet_loss=$PACKET_LOSS --packet_duplication=$PACKET_DUPLICATION --ping=$PING --jitter=$JITTER &> soak_cli_out
|
||||
run_client 1
|
||||
|
||||
exit_soak $?
|
||||
else
|
||||
./client --message_count=$MESSAGE_COUNT --channel_count=$CHANNEL_COUNT --packet_loss=$PACKET_LOSS --packet_duplication=$PACKET_DUPLICATION --ping=$PING --jitter=$JITTER &> soak_cli_out
|
||||
if [ -n "$WEBRTC_NATIVE" ]
|
||||
then
|
||||
# run a UDP client, a webrtc WASM client (emscripten) and a native webrtc client (all connecting to the same server)
|
||||
|
||||
if run_client 0 && run_client 1 && run_client 2; then
|
||||
exit_soak 0
|
||||
else
|
||||
exit_soak 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
RESULT=$?
|
||||
|
||||
# when running the soak test in the latest version of emscripten with node 16
|
||||
# the client aborts at the end when calling emscripten_force_exit
|
||||
# I could not figure out why, hence the condition
|
||||
[[ -n "$EMSCRIPTEN" ]] && EXPECTED_RESULT=7 || EXPECTED_RESULT=0
|
||||
|
||||
if [ $RESULT -eq $EXPECTED_RESULT ]
|
||||
then
|
||||
echo "Soak test completed with success!"
|
||||
echo "Printing the end of client logs..."
|
||||
|
||||
tail -n 150 soak_cli_out
|
||||
|
||||
EXIT_CODE=0
|
||||
else
|
||||
echo "Soak test failed! (code: $RESULT)"
|
||||
echo "Printing the end of client logs..."
|
||||
tail -n 150 soak_cli_out
|
||||
echo "Printing the end of server logs..."
|
||||
tail -n 150 soak_serv_out
|
||||
|
||||
EXIT_CODE=1
|
||||
fi
|
||||
|
||||
kill -SIGINT $SERV_PID 2> /dev/null
|
||||
|
||||
exit $EXIT_CODE
|
||||
@@ -1,7 +1,10 @@
|
||||
cmake_minimum_required(VERSION 3.1)
|
||||
|
||||
project(echo)
|
||||
|
||||
option(CPP_COMPILE OFF)
|
||||
option(ENABLE_TLS OFF)
|
||||
option(WEBRTC_NATIVE OFF)
|
||||
|
||||
# allow to compile as cpp
|
||||
if (CPP_COMPILE)
|
||||
@@ -17,12 +20,45 @@ add_executable(echo_server server.c shared.c)
|
||||
|
||||
add_compile_options(-Wall -Wextra -Wpedantic)
|
||||
|
||||
if (ENABLE_TLS)
|
||||
message("Compile with TLS enabled")
|
||||
target_compile_definitions(echo_server PUBLIC NBN_TLS)
|
||||
target_compile_definitions(echo_client PUBLIC NBN_TLS)
|
||||
endif (ENABLE_TLS)
|
||||
|
||||
unset(ENABLE_TLS)
|
||||
|
||||
if (WEBRTC_NATIVE_SERVER)
|
||||
if (EMSCRIPTEN)
|
||||
message(FATAL_ERROR "Cannot compile native webrtc driver with emscripten")
|
||||
endif (EMSCRIPTEN)
|
||||
|
||||
message("Compile server with webrtc native driver")
|
||||
|
||||
target_compile_definitions(echo_server PUBLIC NBN_WEBRTC_NATIVE)
|
||||
target_link_libraries(echo_server ${LIBDATACHANNEL_LIBRARY_PATH} m)
|
||||
target_include_directories(echo_server PUBLIC "${LIBDATACHANNEL_INCLUDE_PATH}")
|
||||
endif (WEBRTC_NATIVE_SERVER)
|
||||
|
||||
unset(WEBRTC_NATIVE_SERVER)
|
||||
|
||||
if (WEBRTC_NATIVE_CLIENT)
|
||||
if (EMSCRIPTEN)
|
||||
message(FATAL_ERROR "Cannot compile native webrtc driver with emscripten")
|
||||
endif (EMSCRIPTEN)
|
||||
|
||||
message("Compile client with webrtc native driver")
|
||||
|
||||
target_compile_definitions(echo_client PUBLIC NBN_WEBRTC_NATIVE)
|
||||
target_link_libraries(echo_client ${LIBDATACHANNEL_LIBRARY_PATH} m)
|
||||
target_include_directories(echo_client PUBLIC "${LIBDATACHANNEL_INCLUDE_PATH}")
|
||||
endif (WEBRTC_NATIVE_CLIENT)
|
||||
|
||||
unset(WEBRTC_NATIVE_CLIENT)
|
||||
|
||||
target_compile_definitions(echo_client PUBLIC NBN_DEBUG)
|
||||
target_compile_definitions(echo_server PUBLIC NBN_DEBUG)
|
||||
|
||||
option(ENCRYPTION_ENABLED OFF)
|
||||
option(WEBRTC_DRIVER_C OFF)
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(echo_client ws2_32)
|
||||
target_link_libraries(echo_server ws2_32)
|
||||
|
||||
+21
-4
@@ -3,7 +3,9 @@
|
||||
This is a very basic echo client server example, the server accepts a single client at a time and echoes all
|
||||
messages it receives.
|
||||
|
||||
Use the CMake script to compile the example:
|
||||
## UDP
|
||||
|
||||
Use the CMake script to build the example:
|
||||
|
||||
```
|
||||
cmake .
|
||||
@@ -20,12 +22,12 @@ and to run the client:
|
||||
|
||||
The client will run indefinitely and send the provided string to the server every tick (30 times per second).
|
||||
|
||||
## WebRTC (JS driver)
|
||||
## WebRTC
|
||||
|
||||
Use the CMake script to compile the example:
|
||||
To target WASM:
|
||||
|
||||
```
|
||||
EMSCRIPTEN=1 cmake .
|
||||
emcmake cmake .
|
||||
make
|
||||
npm install
|
||||
```
|
||||
@@ -39,3 +41,18 @@ To run the server simply do:
|
||||
and to run the client:
|
||||
|
||||
`npm run client "some message"`
|
||||
|
||||
You can also compile using the native WebRTC driver:
|
||||
|
||||
```
|
||||
cmake -DWEBRTC_NATIVE_SERVER=ON -DLIBDATACHANNEL_LIBRARY_PATH=<PATH TO LIBDATACHANNEL LIBRARY> -DLIBDATACHANNEL_INCLUDE_PATH=<PATH TO LIBDATACHANNEL HEADERS> .
|
||||
make
|
||||
```
|
||||
|
||||
To run the server simply do:
|
||||
|
||||
`./echo_server`
|
||||
|
||||
You should then be able to connect with both UDP and node clients.
|
||||
|
||||
Use `-DWEBRTC_NATIVE_CLIENT=ON` if you want to use the WebRTC native driver on the client instead of UDP.
|
||||
+32
-1
@@ -120,7 +120,34 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
NBN_WebRTC_Register(); // Register the WebRTC driver
|
||||
|
||||
// Register the WebRTC driver
|
||||
#ifdef NBN_TLS
|
||||
NBN_WebRTC_Register((NBN_WebRTC_Config){.enable_tls = true});
|
||||
#else
|
||||
NBN_WebRTC_Register((NBN_WebRTC_Config){.enable_tls = false});
|
||||
#endif // NBN_TLS
|
||||
|
||||
#elif defined(NBN_WEBRTC_NATIVE)
|
||||
|
||||
#ifdef NBN_TLS
|
||||
bool enable_tls = true;
|
||||
#else
|
||||
bool enable_tls = false;
|
||||
#endif // NBN_TLS
|
||||
|
||||
const char *ice_servers[] = { "stun:stun01.sipphone.com" };
|
||||
NBN_WebRTC_C_Config cfg = {
|
||||
.ice_servers = ice_servers,
|
||||
.ice_servers_count = 1,
|
||||
.enable_tls = enable_tls,
|
||||
.cert_path = NULL,
|
||||
.key_path = NULL,
|
||||
.passphrase = NULL,
|
||||
.log_level = RTC_LOG_VERBOSE};
|
||||
|
||||
NBN_WebRTC_C_Register(cfg);
|
||||
|
||||
#else
|
||||
NBN_UDP_Register(); // Register the UDP driver
|
||||
#endif // __EMSCRIPTEN__
|
||||
@@ -223,6 +250,10 @@ int main(int argc, char *argv[])
|
||||
// Stop and deinitialize the client
|
||||
NBN_GameClient_Stop();
|
||||
|
||||
#ifdef NBN_WEBRTC_NATIVE
|
||||
NBN_WebRTC_C_Unregister();
|
||||
#endif
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
emscripten_force_exit(0);
|
||||
#else
|
||||
|
||||
Generated
+872
-9
@@ -1,6 +1,869 @@
|
||||
{
|
||||
"name": "echo",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"lockfileVersion": 1,
|
||||
"packages": {
|
||||
"": {
|
||||
"dependencies": {
|
||||
"nbnet": "file:../../net_drivers/webrtc"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc": {
|
||||
"name": "nbnet",
|
||||
"version": "1.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"websocket": "^1.0.31",
|
||||
"winston": "^3.2.1",
|
||||
"wrtc": "^0.4.2"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/@dabh/diagnostics": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.2.tgz",
|
||||
"integrity": "sha512-+A1YivoVDNNVCdfozHSR8v/jyuuLTMXwjWuxPFlFlUapXoGc+Gj9mDlTDDfrwl7rXCl2tNZ0kE8sIBO6YOn96Q==",
|
||||
"dependencies": {
|
||||
"colorspace": "1.1.x",
|
||||
"enabled": "2.0.x",
|
||||
"kuler": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/abbrev": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
|
||||
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/ansi-regex": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
|
||||
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/aproba": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz",
|
||||
"integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw=="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/are-we-there-yet": {
|
||||
"version": "1.1.5",
|
||||
"resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz",
|
||||
"integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==",
|
||||
"dependencies": {
|
||||
"delegates": "^1.0.0",
|
||||
"readable-stream": "^2.0.6"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/are-we-there-yet/node_modules/readable-stream": {
|
||||
"version": "2.3.7",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
|
||||
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
|
||||
"dependencies": {
|
||||
"core-util-is": "~1.0.0",
|
||||
"inherits": "~2.0.3",
|
||||
"isarray": "~1.0.0",
|
||||
"process-nextick-args": "~2.0.0",
|
||||
"safe-buffer": "~5.1.1",
|
||||
"string_decoder": "~1.1.1",
|
||||
"util-deprecate": "~1.0.1"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/are-we-there-yet/node_modules/safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/are-we-there-yet/node_modules/string_decoder": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
|
||||
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
|
||||
"dependencies": {
|
||||
"safe-buffer": "~5.1.0"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/async": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz",
|
||||
"integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw=="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/balanced-match": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/bufferutil": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.1.tgz",
|
||||
"integrity": "sha512-xowrxvpxojqkagPcWRQVXZl0YXhRhAtBEIq3VoER1NH5Mw1n1o0ojdspp+GS2J//2gCVyrzQDApQ4unGF+QOoA==",
|
||||
"dependencies": {
|
||||
"node-gyp-build": "~3.7.0"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/chownr": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
|
||||
"integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg=="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/code-point-at": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
|
||||
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/color": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/color/-/color-3.0.0.tgz",
|
||||
"integrity": "sha512-jCpd5+s0s0t7p3pHQKpnJ0TpQKKdleP71LWcA0aqiljpiuAkOSUFN/dyH8ZwF0hRmFlrIuRhufds1QyEP9EB+w==",
|
||||
"dependencies": {
|
||||
"color-convert": "^1.9.1",
|
||||
"color-string": "^1.5.2"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/color-convert": {
|
||||
"version": "1.9.3",
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
|
||||
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
|
||||
"dependencies": {
|
||||
"color-name": "1.1.3"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/color-name": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
|
||||
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/color-string": {
|
||||
"version": "1.5.3",
|
||||
"resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.3.tgz",
|
||||
"integrity": "sha512-dC2C5qeWoYkxki5UAXapdjqO672AM4vZuPGRQfO8b5HKuKGBbKWpITyDYN7TOFKvRW7kOgAn3746clDBMDJyQw==",
|
||||
"dependencies": {
|
||||
"color-name": "^1.0.0",
|
||||
"simple-swizzle": "^0.2.2"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/colors": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz",
|
||||
"integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA=="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/colorspace": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.2.tgz",
|
||||
"integrity": "sha512-vt+OoIP2d76xLhjwbBaucYlNSpPsrJWPlBTtwCpQKIu6/CSMutyzX93O/Do0qzpH3YoHEes8YEFXyZ797rEhzQ==",
|
||||
"dependencies": {
|
||||
"color": "3.0.x",
|
||||
"text-hex": "1.0.x"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/console-control-strings": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
|
||||
"integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/core-util-is": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
|
||||
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/d": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz",
|
||||
"integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==",
|
||||
"dependencies": {
|
||||
"es5-ext": "^0.10.50",
|
||||
"type": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/debug": {
|
||||
"version": "2.6.9",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
||||
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
||||
"dependencies": {
|
||||
"ms": "2.0.0"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/deep-extend": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
|
||||
"integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA=="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/delegates": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
|
||||
"integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/detect-libc": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz",
|
||||
"integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/domexception": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz",
|
||||
"integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"webidl-conversions": "^4.0.2"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/enabled": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz",
|
||||
"integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ=="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/es5-ext": {
|
||||
"version": "0.10.53",
|
||||
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz",
|
||||
"integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==",
|
||||
"dependencies": {
|
||||
"es6-iterator": "~2.0.3",
|
||||
"es6-symbol": "~3.1.3",
|
||||
"next-tick": "~1.0.0"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/es6-iterator": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz",
|
||||
"integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=",
|
||||
"dependencies": {
|
||||
"d": "1",
|
||||
"es5-ext": "^0.10.35",
|
||||
"es6-symbol": "^3.1.1"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/es6-symbol": {
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz",
|
||||
"integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==",
|
||||
"dependencies": {
|
||||
"d": "^1.0.1",
|
||||
"ext": "^1.1.2"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/ext": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz",
|
||||
"integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==",
|
||||
"dependencies": {
|
||||
"type": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/ext/node_modules/type": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/type/-/type-2.1.0.tgz",
|
||||
"integrity": "sha512-G9absDWvhAWCV2gmF1zKud3OyC61nZDwWvBL2DApaVFogI07CprggiQAOOjvp2NRjYWFzPyu7vwtDrQFq8jeSA=="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/fast-safe-stringify": {
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz",
|
||||
"integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA=="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/fecha": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.0.tgz",
|
||||
"integrity": "sha512-aN3pcx/DSmtyoovUudctc8+6Hl4T+hI9GBBHLjA76jdZl7+b1sgh5g4k+u/GL3dTy1/pnYzKp69FpJ0OicE3Wg=="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/fn.name": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz",
|
||||
"integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw=="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/fs-minipass": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz",
|
||||
"integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==",
|
||||
"dependencies": {
|
||||
"minipass": "^2.6.0"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/gauge": {
|
||||
"version": "2.7.4",
|
||||
"resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz",
|
||||
"integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=",
|
||||
"dependencies": {
|
||||
"aproba": "^1.0.3",
|
||||
"console-control-strings": "^1.0.0",
|
||||
"has-unicode": "^2.0.0",
|
||||
"object-assign": "^4.1.0",
|
||||
"signal-exit": "^3.0.0",
|
||||
"string-width": "^1.0.1",
|
||||
"strip-ansi": "^3.0.1",
|
||||
"wide-align": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/glob": {
|
||||
"version": "7.1.6",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
|
||||
"integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
|
||||
"dependencies": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^3.0.4",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/has-unicode": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
|
||||
"integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/iconv-lite": {
|
||||
"version": "0.4.24",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
|
||||
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
|
||||
"dependencies": {
|
||||
"safer-buffer": ">= 2.1.2 < 3"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/ignore-walk": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.3.tgz",
|
||||
"integrity": "sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw==",
|
||||
"dependencies": {
|
||||
"minimatch": "^3.0.4"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/inflight": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
||||
"dependencies": {
|
||||
"once": "^1.3.0",
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/ini": {
|
||||
"version": "1.3.5",
|
||||
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
|
||||
"integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw=="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/is-arrayish": {
|
||||
"version": "0.3.2",
|
||||
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz",
|
||||
"integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ=="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/is-fullwidth-code-point": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
|
||||
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
|
||||
"dependencies": {
|
||||
"number-is-nan": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/is-stream": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz",
|
||||
"integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw=="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/is-typedarray": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
|
||||
"integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/isarray": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
|
||||
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/kuler": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz",
|
||||
"integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A=="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/logform": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/logform/-/logform-2.2.0.tgz",
|
||||
"integrity": "sha512-N0qPlqfypFx7UHNn4B3lzS/b0uLqt2hmuoa+PpuXNYgozdJYAyauF5Ky0BWVjrxDlMWiT3qN4zPq3vVAfZy7Yg==",
|
||||
"dependencies": {
|
||||
"colors": "^1.2.1",
|
||||
"fast-safe-stringify": "^2.0.4",
|
||||
"fecha": "^4.2.0",
|
||||
"ms": "^2.1.1",
|
||||
"triple-beam": "^1.3.0"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/logform/node_modules/ms": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/minimatch": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/minimist": {
|
||||
"version": "1.2.5",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
|
||||
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/minipass": {
|
||||
"version": "2.9.0",
|
||||
"resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz",
|
||||
"integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==",
|
||||
"dependencies": {
|
||||
"safe-buffer": "^5.1.2",
|
||||
"yallist": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/minizlib": {
|
||||
"version": "1.3.3",
|
||||
"resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz",
|
||||
"integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==",
|
||||
"dependencies": {
|
||||
"minipass": "^2.9.0"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/mkdirp": {
|
||||
"version": "0.5.5",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
|
||||
"integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
|
||||
"dependencies": {
|
||||
"minimist": "^1.2.5"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/ms": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
||||
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/needle": {
|
||||
"version": "2.5.2",
|
||||
"resolved": "https://registry.npmjs.org/needle/-/needle-2.5.2.tgz",
|
||||
"integrity": "sha512-LbRIwS9BfkPvNwNHlsA41Q29kL2L/6VaOJ0qisM5lLWsTV3nP15abO5ITL6L81zqFhzjRKDAYjpcBcwM0AVvLQ==",
|
||||
"dependencies": {
|
||||
"debug": "^3.2.6",
|
||||
"iconv-lite": "^0.4.4",
|
||||
"sax": "^1.2.4"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/needle/node_modules/debug": {
|
||||
"version": "3.2.6",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
|
||||
"integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
|
||||
"dependencies": {
|
||||
"ms": "^2.1.1"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/needle/node_modules/ms": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/next-tick": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz",
|
||||
"integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/node-gyp-build": {
|
||||
"version": "3.7.0",
|
||||
"resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-3.7.0.tgz",
|
||||
"integrity": "sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w=="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/node-pre-gyp": {
|
||||
"version": "0.13.0",
|
||||
"resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.13.0.tgz",
|
||||
"integrity": "sha512-Md1D3xnEne8b/HGVQkZZwV27WUi1ZRuZBij24TNaZwUPU3ZAFtvT6xxJGaUVillfmMKnn5oD1HoGsp2Ftik7SQ==",
|
||||
"dependencies": {
|
||||
"detect-libc": "^1.0.2",
|
||||
"mkdirp": "^0.5.1",
|
||||
"needle": "^2.2.1",
|
||||
"nopt": "^4.0.1",
|
||||
"npm-packlist": "^1.1.6",
|
||||
"npmlog": "^4.0.2",
|
||||
"rc": "^1.2.7",
|
||||
"rimraf": "^2.6.1",
|
||||
"semver": "^5.3.0",
|
||||
"tar": "^4"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/nopt": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz",
|
||||
"integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==",
|
||||
"dependencies": {
|
||||
"abbrev": "1",
|
||||
"osenv": "^0.1.4"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/npm-bundled": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.1.tgz",
|
||||
"integrity": "sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA==",
|
||||
"dependencies": {
|
||||
"npm-normalize-package-bin": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/npm-normalize-package-bin": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz",
|
||||
"integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA=="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/npm-packlist": {
|
||||
"version": "1.4.8",
|
||||
"resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.8.tgz",
|
||||
"integrity": "sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A==",
|
||||
"dependencies": {
|
||||
"ignore-walk": "^3.0.1",
|
||||
"npm-bundled": "^1.0.1",
|
||||
"npm-normalize-package-bin": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/npmlog": {
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz",
|
||||
"integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==",
|
||||
"dependencies": {
|
||||
"are-we-there-yet": "~1.1.2",
|
||||
"console-control-strings": "~1.1.0",
|
||||
"gauge": "~2.7.3",
|
||||
"set-blocking": "~2.0.0"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/number-is-nan": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
|
||||
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/object-assign": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
||||
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||
"dependencies": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/one-time": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz",
|
||||
"integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==",
|
||||
"dependencies": {
|
||||
"fn.name": "1.x.x"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/os-homedir": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
|
||||
"integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/os-tmpdir": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
|
||||
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/osenv": {
|
||||
"version": "0.1.5",
|
||||
"resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz",
|
||||
"integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==",
|
||||
"dependencies": {
|
||||
"os-homedir": "^1.0.0",
|
||||
"os-tmpdir": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/process-nextick-args": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
||||
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/rc": {
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz",
|
||||
"integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==",
|
||||
"dependencies": {
|
||||
"deep-extend": "^0.6.0",
|
||||
"ini": "~1.3.0",
|
||||
"minimist": "^1.2.0",
|
||||
"strip-json-comments": "~2.0.1"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/readable-stream": {
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
|
||||
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
|
||||
"dependencies": {
|
||||
"inherits": "^2.0.3",
|
||||
"string_decoder": "^1.1.1",
|
||||
"util-deprecate": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/rimraf": {
|
||||
"version": "2.7.1",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
|
||||
"integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
|
||||
"dependencies": {
|
||||
"glob": "^7.1.3"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/safe-buffer": {
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
||||
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/sax": {
|
||||
"version": "1.2.4",
|
||||
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
|
||||
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/semver": {
|
||||
"version": "5.7.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
|
||||
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ=="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/set-blocking": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
|
||||
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/signal-exit": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz",
|
||||
"integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA=="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/simple-swizzle": {
|
||||
"version": "0.2.2",
|
||||
"resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz",
|
||||
"integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=",
|
||||
"dependencies": {
|
||||
"is-arrayish": "^0.3.1"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/stack-trace": {
|
||||
"version": "0.0.10",
|
||||
"resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz",
|
||||
"integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/string_decoder": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
|
||||
"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
|
||||
"dependencies": {
|
||||
"safe-buffer": "~5.2.0"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/string-width": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
|
||||
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
|
||||
"dependencies": {
|
||||
"code-point-at": "^1.0.0",
|
||||
"is-fullwidth-code-point": "^1.0.0",
|
||||
"strip-ansi": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/strip-ansi": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
|
||||
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
|
||||
"dependencies": {
|
||||
"ansi-regex": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/strip-json-comments": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
|
||||
"integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/tar": {
|
||||
"version": "4.4.13",
|
||||
"resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz",
|
||||
"integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==",
|
||||
"dependencies": {
|
||||
"chownr": "^1.1.1",
|
||||
"fs-minipass": "^1.2.5",
|
||||
"minipass": "^2.8.6",
|
||||
"minizlib": "^1.2.1",
|
||||
"mkdirp": "^0.5.0",
|
||||
"safe-buffer": "^5.1.2",
|
||||
"yallist": "^3.0.3"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/text-hex": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz",
|
||||
"integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg=="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/triple-beam": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz",
|
||||
"integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw=="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/type": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz",
|
||||
"integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg=="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/typedarray-to-buffer": {
|
||||
"version": "3.1.5",
|
||||
"resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz",
|
||||
"integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==",
|
||||
"dependencies": {
|
||||
"is-typedarray": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/utf-8-validate": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.2.tgz",
|
||||
"integrity": "sha512-SwV++i2gTD5qh2XqaPzBnNX88N6HdyhQrNNRykvcS0QKvItV9u3vPEJr+X5Hhfb1JC0r0e1alL0iB09rY8+nmw==",
|
||||
"dependencies": {
|
||||
"node-gyp-build": "~3.7.0"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/webidl-conversions": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz",
|
||||
"integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==",
|
||||
"optional": true
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/websocket": {
|
||||
"version": "1.0.32",
|
||||
"resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.32.tgz",
|
||||
"integrity": "sha512-i4yhcllSP4wrpoPMU2N0TQ/q0O94LRG/eUQjEAamRltjQ1oT1PFFKOG4i877OlJgCG8rw6LrrowJp+TYCEWF7Q==",
|
||||
"dependencies": {
|
||||
"bufferutil": "^4.0.1",
|
||||
"debug": "^2.2.0",
|
||||
"es5-ext": "^0.10.50",
|
||||
"typedarray-to-buffer": "^3.1.5",
|
||||
"utf-8-validate": "^5.0.2",
|
||||
"yaeti": "^0.0.6"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/wide-align": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz",
|
||||
"integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==",
|
||||
"dependencies": {
|
||||
"string-width": "^1.0.2 || 2"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/winston": {
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/winston/-/winston-3.3.3.tgz",
|
||||
"integrity": "sha512-oEXTISQnC8VlSAKf1KYSSd7J6IWuRPQqDdo8eoRNaYKLvwSb5+79Z3Yi1lrl6KDpU6/VWaxpakDAtb1oQ4n9aw==",
|
||||
"dependencies": {
|
||||
"@dabh/diagnostics": "^2.0.2",
|
||||
"async": "^3.1.0",
|
||||
"is-stream": "^2.0.0",
|
||||
"logform": "^2.2.0",
|
||||
"one-time": "^1.0.0",
|
||||
"readable-stream": "^3.4.0",
|
||||
"stack-trace": "0.0.x",
|
||||
"triple-beam": "^1.3.0",
|
||||
"winston-transport": "^4.4.0"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/winston-transport": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.4.0.tgz",
|
||||
"integrity": "sha512-Lc7/p3GtqtqPBYYtS6KCN3c77/2QCev51DvcJKbkFPQNoj1sinkGwLGFDxkXY9J6p9+EPnYs+D90uwbnaiURTw==",
|
||||
"dependencies": {
|
||||
"readable-stream": "^2.3.7",
|
||||
"triple-beam": "^1.2.0"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/winston-transport/node_modules/readable-stream": {
|
||||
"version": "2.3.7",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
|
||||
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
|
||||
"dependencies": {
|
||||
"core-util-is": "~1.0.0",
|
||||
"inherits": "~2.0.3",
|
||||
"isarray": "~1.0.0",
|
||||
"process-nextick-args": "~2.0.0",
|
||||
"safe-buffer": "~5.1.1",
|
||||
"string_decoder": "~1.1.1",
|
||||
"util-deprecate": "~1.0.1"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/winston-transport/node_modules/safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/winston-transport/node_modules/string_decoder": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
|
||||
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
|
||||
"dependencies": {
|
||||
"safe-buffer": "~5.1.0"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/wrtc": {
|
||||
"version": "0.4.6",
|
||||
"resolved": "https://registry.npmjs.org/wrtc/-/wrtc-0.4.6.tgz",
|
||||
"integrity": "sha512-4uD+oFoY2yuo3AV9fum3cXUXR6v8YQHZlqBrKkCRGjW1BvKrVHtLNH4UaNLBLiJu9DL89WqUWmbzsQ9RxMzANw==",
|
||||
"dependencies": {
|
||||
"node-pre-gyp": "^0.13.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"domexception": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/yaeti": {
|
||||
"version": "0.0.6",
|
||||
"resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz",
|
||||
"integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc="
|
||||
},
|
||||
"../../net_drivers/webrtc/node_modules/yallist": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
|
||||
"integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="
|
||||
},
|
||||
"node_modules/nbnet": {
|
||||
"resolved": "../../net_drivers/webrtc",
|
||||
"link": true
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"nbnet": {
|
||||
"version": "file:../../net_drivers/webrtc",
|
||||
@@ -673,6 +1536,14 @@
|
||||
"resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz",
|
||||
"integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA="
|
||||
},
|
||||
"string_decoder": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
|
||||
"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
|
||||
"requires": {
|
||||
"safe-buffer": "~5.2.0"
|
||||
}
|
||||
},
|
||||
"string-width": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
|
||||
@@ -683,14 +1554,6 @@
|
||||
"strip-ansi": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"string_decoder": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
|
||||
"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
|
||||
"requires": {
|
||||
"safe-buffer": "~5.2.0"
|
||||
}
|
||||
},
|
||||
"strip-ansi": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"scripts": {
|
||||
"server": "node echo_server.js",
|
||||
"client": "node echo_client.js"
|
||||
"server": "node build_web/echo_server.js",
|
||||
"client": "node build_web/echo_client.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"nbnet": "file:../../net_drivers/webrtc"
|
||||
|
||||
+44
-2
@@ -20,6 +20,7 @@
|
||||
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -61,11 +62,48 @@ static int EchoReceivedMessage(void)
|
||||
|
||||
static bool error = false;
|
||||
|
||||
int main(void)
|
||||
int main(int argc, const char **argv)
|
||||
{
|
||||
#ifdef __EMSCRIPTEN__
|
||||
NBN_WebRTC_Register(); // Register the WebRTC driver
|
||||
|
||||
// Register the WebRTC driver
|
||||
#ifdef NBN_TLS
|
||||
|
||||
if (argc != 3)
|
||||
{
|
||||
printf("Usage: server CERT_PATH KEY_PATH\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
const char *cert_path = argv[1];
|
||||
const char *key_path = argv[2];
|
||||
|
||||
NBN_WebRTC_Register((NBN_WebRTC_Config){.enable_tls = true, .cert_path = cert_path, .key_path = key_path});
|
||||
#else
|
||||
NBN_WebRTC_Register((NBN_WebRTC_Config){.enable_tls = false});
|
||||
#endif // NBN_TLS
|
||||
|
||||
#elif defined(NBN_WEBRTC_NATIVE)
|
||||
|
||||
// Register native WebRTC driver
|
||||
|
||||
#ifdef NBN_TLS
|
||||
bool enable_tls = true;
|
||||
#else
|
||||
bool enable_tls = false;
|
||||
#endif // NBN_TLS
|
||||
|
||||
const char *ice_servers[] = { "stun:stun01.sipphone.com" };
|
||||
NBN_WebRTC_C_Config cfg = {
|
||||
.ice_servers = ice_servers,
|
||||
.ice_servers_count = 1,
|
||||
.enable_tls = enable_tls,
|
||||
.cert_path = NULL,
|
||||
.key_path = NULL,
|
||||
.passphrase = NULL,
|
||||
.log_level = RTC_LOG_VERBOSE};
|
||||
|
||||
NBN_WebRTC_C_Register(cfg);
|
||||
NBN_UDP_Register(); // Register the UDP driver
|
||||
#endif // __EMSCRIPTEN__
|
||||
|
||||
@@ -167,6 +205,10 @@ int main(void)
|
||||
// Stop the server
|
||||
NBN_GameServer_Stop();
|
||||
|
||||
#ifdef NBN_WEBRTC_NATIVE
|
||||
NBN_WebRTC_C_Unregister();
|
||||
#endif
|
||||
|
||||
int ret = error ? 1 : 0;
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
|
||||
+11
-1
@@ -54,10 +54,20 @@ void Log(int, const char *, ...);
|
||||
#include "../../nbnet.h"
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
|
||||
#include "../../net_drivers/webrtc.h"
|
||||
|
||||
#else
|
||||
|
||||
#include "../../net_drivers/udp.h"
|
||||
#endif
|
||||
|
||||
#ifdef NBN_WEBRTC_NATIVE
|
||||
|
||||
#include "../../net_drivers/webrtc_c.h"
|
||||
|
||||
#endif // NBN_WEBRTC_NATIVE
|
||||
|
||||
#endif // __EMSCRIPTEN__
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
||||
+14
-20
@@ -31,7 +31,14 @@ freely, subject to the following restrictions:
|
||||
2. Call NBN_WebRTC_Register in both your client and server code before calling NBN_GameClient_Start or NBN_GameServer_Start
|
||||
*/
|
||||
|
||||
void NBN_WebRTC_Register(void);
|
||||
typedef struct NBN_WebRTC_Config
|
||||
{
|
||||
bool enable_tls;
|
||||
const char *cert_path;
|
||||
const char *key_path;
|
||||
} NBN_WebRTC_Config;
|
||||
|
||||
void NBN_WebRTC_Register(NBN_WebRTC_Config config);
|
||||
|
||||
#ifdef NBNET_IMPL
|
||||
|
||||
@@ -287,22 +294,11 @@ typedef struct NBN_WebRTC_Server
|
||||
} NBN_WebRTC_Server;
|
||||
|
||||
static NBN_WebRTC_Server nbn_wrtc_serv = {NULL, {0}, 0, false};
|
||||
static NBN_WebRTC_Config nbn_wrtc_cfg;
|
||||
|
||||
static int NBN_WebRTC_ServStart(uint32_t protocol_id, uint16_t port, bool enable_encryption)
|
||||
{
|
||||
#ifdef NBN_USE_HTTPS
|
||||
|
||||
#ifndef NBN_HTTPS_KEY_PEM
|
||||
#define NBN_HTTPS_KEY_PEM "key.pem"
|
||||
#endif
|
||||
|
||||
#ifndef NBN_HTTPS_CERT_PEM
|
||||
#define NBN_HTTPS_CERT_PEM "cert.pem"
|
||||
#endif
|
||||
__js_game_server_init(protocol_id, true, NBN_HTTPS_KEY_PEM, NBN_HTTPS_CERT_PEM);
|
||||
#else
|
||||
__js_game_server_init(protocol_id, false, NULL, NULL);
|
||||
#endif // NBN_USE_HTTPS
|
||||
__js_game_server_init(protocol_id, nbn_wrtc_cfg.enable_tls, nbn_wrtc_cfg.key_path, nbn_wrtc_cfg.cert_path);
|
||||
|
||||
if (__js_game_server_start(port) < 0)
|
||||
return -1;
|
||||
@@ -408,11 +404,7 @@ static NBN_WebRTC_Client nbn_wrtc_cli = {NULL};
|
||||
|
||||
static int NBN_WebRTC_CliStart(uint32_t protocol_id, const char *host, uint16_t port, bool enable_encryption)
|
||||
{
|
||||
#ifdef NBN_USE_HTTPS
|
||||
__js_game_client_init(protocol_id, true);
|
||||
#else
|
||||
__js_game_client_init(protocol_id, false);
|
||||
#endif // NBN_USE_HTTPS
|
||||
__js_game_client_init(protocol_id, nbn_wrtc_cfg.enable_tls);
|
||||
|
||||
nbn_wrtc_cli.server_conn = NBN_GameClient_CreateServerConnection(NBN_WEBRTC_DRIVER_ID, NULL, protocol_id, enable_encryption);
|
||||
|
||||
@@ -455,7 +447,7 @@ static int NBN_WebRTC_CliSendPacket(NBN_Packet *packet)
|
||||
|
||||
#pragma region Driver registering
|
||||
|
||||
void NBN_WebRTC_Register(void)
|
||||
void NBN_WebRTC_Register(NBN_WebRTC_Config config)
|
||||
{
|
||||
NBN_DriverImplementation driver_impl = {
|
||||
// Client implementation
|
||||
@@ -472,6 +464,8 @@ void NBN_WebRTC_Register(void)
|
||||
NBN_WebRTC_ServRemoveClientConnection
|
||||
};
|
||||
|
||||
nbn_wrtc_cfg = config;
|
||||
|
||||
NBN_Driver_Register(
|
||||
NBN_WEBRTC_DRIVER_ID,
|
||||
NBN_WEBRTC_DRIVER_NAME,
|
||||
|
||||
@@ -25,6 +25,7 @@ freely, subject to the following restrictions:
|
||||
mergeInto(LibraryManager.library, {
|
||||
__js_game_server_send_packet_to__proxy: 'sync',
|
||||
__js_game_server_dequeue_packet__proxy: 'sync',
|
||||
__js_game_server_dequeue_packet__deps: ['$writeArrayToMemory'],
|
||||
|
||||
__js_game_server_init: function (protocol_id, use_https, key_pem, cert_pem) {
|
||||
const nbnet = require('nbnet')
|
||||
@@ -84,6 +85,7 @@ mergeInto(LibraryManager.library, {
|
||||
mergeInto(LibraryManager.library, {
|
||||
__js_game_client_send_packet__proxy: 'sync',
|
||||
__js_game_client_dequeue_packet__proxy: 'sync',
|
||||
__js_game_client_dequeue_packet__deps: ['$writeArrayToMemory'],
|
||||
|
||||
__js_game_client_init: function(protocol_id, use_https) {
|
||||
let nbnet
|
||||
|
||||
@@ -12,11 +12,11 @@ SignalingClient.prototype.connect = function(host, port) {
|
||||
const uri = this.options['https'] ? `wss://${host}:${port}` : `ws://${host}:${port}`
|
||||
|
||||
this.logger.info(this.options['https'])
|
||||
this.logger.info(`Connecting to ${uri} (protocol: %s)...`, this.protocol)
|
||||
this.logger.info(`Connecting to ${uri}...`)
|
||||
|
||||
const WebSocket = require('websocket').w3cwebsocket
|
||||
|
||||
this.ws = new WebSocket(uri, this.protocol)
|
||||
this.ws = new WebSocket(uri)
|
||||
|
||||
this.ws.onclose = (ev) => {
|
||||
if (this.connected) {
|
||||
|
||||
@@ -32,7 +32,7 @@ SignalingServer.prototype.start = function(port) {
|
||||
this.logger.info('New connection')
|
||||
|
||||
try {
|
||||
this.onConnection(new Connection(request.accept(this.protocol, request.origin)))
|
||||
this.onConnection(new Connection(request.accept(null, request.origin)))
|
||||
} catch (err) {
|
||||
this.logger.error('Connection rejected: %s', err)
|
||||
}
|
||||
|
||||
+524
-249
@@ -21,16 +21,15 @@ freely, subject to the following restrictions:
|
||||
*/
|
||||
|
||||
/*
|
||||
--- NBNET C (NATIVE) WEBRTC DRIVER ---
|
||||
--- NBNET NATIVE WEBRTC DRIVER ---
|
||||
|
||||
WebRTC driver for the nbnet library, using a single unreliable data channel. As opposed to the other emscripten/JS
|
||||
based WebRTC driver (webrtc.h), this one is fully written in C99 and can be compiled as a native application.
|
||||
|
||||
Dependencies:
|
||||
|
||||
1. facil.io (https://github.com/boazsegev/facil.io)
|
||||
2. libdatachannel (https://github.com/paullouisageneau/libdatachannel)
|
||||
3. json.h (https://github.com/sheredom/json.h)
|
||||
1. libdatachannel (https://github.com/paullouisageneau/libdatachannel)
|
||||
2. json.h (https://github.com/sheredom/json.h)
|
||||
|
||||
How to use:
|
||||
|
||||
@@ -38,16 +37,29 @@ freely, subject to the following restrictions:
|
||||
2. Call NBN_WebRTC_C_Register in both your client and server code before calling NBN_GameClient_Start or NBN_GameServer_Start
|
||||
*/
|
||||
|
||||
#include <http.h>
|
||||
#include <fio_tls.h>
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
#include <rtc/rtc.h>
|
||||
#include <pthread.h>
|
||||
#include "json.h"
|
||||
|
||||
#define NBN_WEBRTC_C_DRIVER_ID 2
|
||||
#define NBN_WEBRTC_C_DRIVER_NAME "WebRTC_C"
|
||||
|
||||
void NBN_WebRTC_C_Register(void);
|
||||
typedef struct NBN_WebRTC_C_Config
|
||||
{
|
||||
bool enable_tls;
|
||||
const char *cert_path;
|
||||
const char *key_path;
|
||||
const char *passphrase;
|
||||
const char **ice_servers;
|
||||
unsigned int ice_servers_count;
|
||||
rtcLogLevel log_level;
|
||||
} NBN_WebRTC_C_Config;
|
||||
|
||||
static NBN_WebRTC_C_Config nbn_wrtc_c_cfg;
|
||||
|
||||
void NBN_WebRTC_C_Register(NBN_WebRTC_C_Config config);
|
||||
void NBN_WebRTC_C_Unregister(void);
|
||||
|
||||
#ifdef NBNET_IMPL
|
||||
|
||||
@@ -55,7 +67,7 @@ typedef struct
|
||||
{
|
||||
int id;
|
||||
int channel_id;
|
||||
ws_s *ws;
|
||||
int ws;
|
||||
NBN_Connection *conn;
|
||||
} NBN_WebRTC_C_Peer;
|
||||
|
||||
@@ -108,7 +120,9 @@ static NBN_WebRTC_C_HTable *NBN_WebRTC_C_HTable_CreateWithCapacity(unsigned int
|
||||
htable->load_factor = 0;
|
||||
|
||||
for (unsigned int i = 0; i < htable->capacity; i++)
|
||||
{
|
||||
htable->internal_array[i] = NULL;
|
||||
}
|
||||
|
||||
return htable;
|
||||
}
|
||||
@@ -276,358 +290,402 @@ static void NBN_WebRTC_C_HTable_Grow(NBN_WebRTC_C_HTable *htable)
|
||||
|
||||
#pragma region String utils
|
||||
|
||||
static int NBN_WebRTC_C_StringReplaceAll(char *res, unsigned int len, const char *str, const char *a, const char *b)
|
||||
// IMPORTANT: res needs to be pre allocated and big enough to old the resulting string
|
||||
static void NBN_WebRTC_C_StringReplaceAll(char *res, const char *str, const char *a, const char *b)
|
||||
{
|
||||
char *substr = strstr(str, a);
|
||||
char *res2 = malloc(len);
|
||||
size_t len_a = strlen(a);
|
||||
size_t len_b = strlen(b);
|
||||
|
||||
if (substr)
|
||||
{
|
||||
size_t len_a = strlen(a);
|
||||
size_t len_b = strlen(b);
|
||||
|
||||
if (strlen(str) + (len_b - len_a) >= len)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int pos = substr - str;
|
||||
|
||||
strncpy(res2, str, pos);
|
||||
strncpy(res2 + pos, b, len_b);
|
||||
strncpy(res2 + pos + len_b, str + pos + len_a, len - (pos + len_a) + 1);
|
||||
memcpy(res, res2, len);
|
||||
NBN_WebRTC_C_StringReplaceAll(res, len, res2, a, b);
|
||||
free(res2);
|
||||
strncpy(res, str, pos);
|
||||
strncpy(res + pos, b, len_b);
|
||||
|
||||
NBN_WebRTC_C_StringReplaceAll(res + pos + len_b, str + pos + len_a, a, b);
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(res, str, len);
|
||||
strncpy(res, str, strlen(str) + 1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#pragma endregion /* String utils */
|
||||
|
||||
#pragma region Signaling
|
||||
#pragma region WebRTC common
|
||||
|
||||
typedef enum
|
||||
static char *NBN_WebRTC_C_ParseSignalingMessage(const char *msg, size_t msg_len, const char *type)
|
||||
{
|
||||
NBN_WEBRTC_C_UNDEFINED,
|
||||
NBN_WEBRTC_C_OFFER
|
||||
} NBN_WebRTC_C_SignalingPayloadType;
|
||||
char *sdp = NULL;
|
||||
struct json_value_s* root = json_parse(msg, msg_len); // this has to be freed
|
||||
|
||||
typedef struct
|
||||
{
|
||||
NBN_WebRTC_C_SignalingPayloadType type;
|
||||
const char *sdp;
|
||||
struct json_value_s *json;
|
||||
} NBN_WebRTC_C_SignalingPayload;
|
||||
|
||||
#define DEFAULT_ICE_SERVER "stun:stun01.sipphone.com"
|
||||
|
||||
#ifndef ICE_SERVERS
|
||||
#define ICE_SERVERS DEFAULT_ICE_SERVER
|
||||
#endif
|
||||
|
||||
static const char *ice_servers[] = {
|
||||
DEFAULT_ICE_SERVER
|
||||
};
|
||||
|
||||
static bool NBN_WebRTC_C_ParseSignalingMessage(const char *msg, size_t msg_len, NBN_WebRTC_C_SignalingPayload *payload)
|
||||
{
|
||||
struct json_value_s* root = json_parse(msg, msg_len);
|
||||
|
||||
if (root->type != json_type_object)
|
||||
{
|
||||
free(root);
|
||||
return false;
|
||||
NBN_LogDebug("Received an invalid signaling message: %s", msg);
|
||||
goto leave_free_root;
|
||||
}
|
||||
|
||||
struct json_object_s* object = (struct json_object_s*)root->payload;
|
||||
struct json_object_element_s *curr = object->start;
|
||||
|
||||
payload->json = root;
|
||||
payload->type = NBN_WEBRTC_C_UNDEFINED;
|
||||
payload->sdp = NULL;
|
||||
|
||||
while (curr != NULL)
|
||||
{
|
||||
if (strncmp(curr->name->string, "type", 4) == 0)
|
||||
{
|
||||
payload->type = NBN_WEBRTC_C_OFFER;
|
||||
struct json_string_s *str = json_value_as_string(curr->value);
|
||||
|
||||
if (strncmp(str->string, type, strlen(type)))
|
||||
{
|
||||
// unexpected type
|
||||
NBN_LogDebug("Received a signaling message with an unexpected type: %s (expected: %s)", str->string, type);
|
||||
sdp = NULL;
|
||||
goto leave_free_root;
|
||||
}
|
||||
}
|
||||
else if (strncmp(curr->name->string, "sdp", 4) == 0)
|
||||
else if (strncmp(curr->name->string, "sdp", 3) == 0)
|
||||
{
|
||||
struct json_string_s *str = json_value_as_string(curr->value);
|
||||
|
||||
if (str)
|
||||
{
|
||||
payload->sdp = str->string;
|
||||
// strdup equivalent using NBN_Allocator, make sure this get freed
|
||||
size_t len = strlen(str->string);
|
||||
|
||||
sdp = NBN_Allocator(len + 1);
|
||||
memcpy(sdp, str->string, len + 1);
|
||||
}
|
||||
}
|
||||
|
||||
curr = curr->next;
|
||||
}
|
||||
|
||||
if (payload->type == NBN_WEBRTC_C_UNDEFINED)
|
||||
{
|
||||
free(root);
|
||||
return false;
|
||||
}
|
||||
leave_free_root:
|
||||
free(root);
|
||||
|
||||
return true;
|
||||
return sdp;
|
||||
}
|
||||
|
||||
static char *NBN_WebRTC_C_EscapeSDP(const char *sdp)
|
||||
{
|
||||
unsigned int len = strlen(sdp) * 2;
|
||||
char *escaped_sdp = malloc(len);
|
||||
size_t len = strlen(sdp) * 2; // TODO: kinda lame way of making sure it's going to be big enough, find a better way
|
||||
char *escaped_sdp = NBN_Allocator(len);
|
||||
|
||||
if (NBN_WebRTC_C_StringReplaceAll(escaped_sdp, len, sdp, "\r\n", "\\r\\n") < 0)
|
||||
{
|
||||
free(escaped_sdp);
|
||||
return NULL;
|
||||
}
|
||||
NBN_WebRTC_C_StringReplaceAll(escaped_sdp, sdp, "\r\n", "\\r\\n");
|
||||
|
||||
return escaped_sdp;
|
||||
}
|
||||
|
||||
static void NBN_WebRTC_C_OnLocalDescriptionCallback(int pc, const char *sdp, const char *type, void *user_ptr)
|
||||
static void NBN_WebRTC_C_Log(rtcLogLevel level, const char *msg)
|
||||
{
|
||||
if (strncmp(type, "answer", 5) != 0) return;
|
||||
switch (level)
|
||||
{
|
||||
case RTC_LOG_FATAL:
|
||||
case RTC_LOG_ERROR:
|
||||
NBN_LogError(msg);
|
||||
break;
|
||||
|
||||
ws_s *ws = user_ptr;
|
||||
fio_str_info_s msg;
|
||||
char data[1024];
|
||||
char *escaped_sdp = NBN_WebRTC_C_EscapeSDP(sdp);
|
||||
case RTC_LOG_WARNING:
|
||||
NBN_LogWarning(msg);
|
||||
break;
|
||||
|
||||
assert(escaped_sdp);
|
||||
snprintf(data, sizeof(data), "{\"type\":\"answer\", \"sdp\":\"%s\"}", escaped_sdp);
|
||||
free(escaped_sdp);
|
||||
case RTC_LOG_INFO:
|
||||
NBN_LogInfo(msg);
|
||||
break;
|
||||
|
||||
msg.data = data;
|
||||
msg.len = strnlen(data, sizeof(data));
|
||||
case RTC_LOG_DEBUG:
|
||||
NBN_LogDebug(msg);
|
||||
break;
|
||||
|
||||
websocket_write(ws, msg, 1);
|
||||
case RTC_LOG_VERBOSE:
|
||||
NBN_LogTrace(msg);
|
||||
break;
|
||||
|
||||
case RTC_LOG_NONE:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma endregion /* Signaling */
|
||||
static void NBN_WebRTC_C_OnWsError(int ws, const char *err_msg, void *user_ptr)
|
||||
{
|
||||
(void)user_ptr;
|
||||
|
||||
NBN_LogError("Error on WS %d: %s", ws, err_msg);
|
||||
}
|
||||
|
||||
static NBN_WebRTC_C_Peer *NBN_WebRTC_C_CreatePeer(
|
||||
int ws,
|
||||
rtcDescriptionCallbackFunc on_rtc_description_cb,
|
||||
rtcStateChangeCallbackFunc on_state_change_cb)
|
||||
{
|
||||
int peer_id = rtcCreatePeerConnection(&(rtcConfiguration){
|
||||
.iceServers = nbn_wrtc_c_cfg.ice_servers,
|
||||
.iceServersCount = nbn_wrtc_c_cfg.ice_servers_count,
|
||||
.disableAutoNegotiation = false
|
||||
});
|
||||
|
||||
if (peer_id < 0)
|
||||
{
|
||||
NBN_LogError("Failed to create peer: %d", peer_id);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
NBN_WebRTC_C_Peer *peer = (NBN_WebRTC_C_Peer *)NBN_Allocator(sizeof(NBN_WebRTC_C_Peer));
|
||||
|
||||
peer->id = peer_id;
|
||||
peer->ws = ws;
|
||||
peer->channel_id = -1;
|
||||
|
||||
rtcSetUserPointer(peer_id, peer);
|
||||
rtcSetUserPointer(ws, peer);
|
||||
|
||||
int ret = rtcSetLocalDescriptionCallback(peer->id, on_rtc_description_cb);
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
NBN_LogError("Failed to register local description callback for peer %d: %d", peer->id, ret);
|
||||
NBN_WebRTC_C_DestroyPeer(peer);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ret = rtcSetStateChangeCallback(peer_id, on_state_change_cb);
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
NBN_LogError("Failed to register state change callback for peer %d: %d", peer_id, ret);
|
||||
NBN_WebRTC_C_DestroyPeer(peer);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int channel_id = rtcCreateDataChannelEx(peer_id, "unreliable", &(rtcDataChannelInit){
|
||||
.reliability = {.unordered = true, .unreliable = true, .maxPacketLifeTime = 1000, .maxRetransmits = 0},
|
||||
.negotiated = true,
|
||||
.manualStream = true,
|
||||
.stream = 0
|
||||
});
|
||||
|
||||
if (channel_id < 0)
|
||||
{
|
||||
NBN_LogError("Failed to create data channel for peer %d: %d", peer_id, channel_id);
|
||||
NBN_WebRTC_C_DestroyPeer(peer);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
peer->channel_id = channel_id;
|
||||
|
||||
NBN_LogDebug("Successfully created data channel for peer %d: %d", peer_id, channel_id);
|
||||
|
||||
return peer;
|
||||
}
|
||||
|
||||
static void NBN_WebRTC_C_DestroyPeer(NBN_WebRTC_C_Peer *peer)
|
||||
{
|
||||
NBN_LogDebug("Destroying peer %d", peer->id);
|
||||
|
||||
if (peer->channel_id >= 0)
|
||||
{
|
||||
rtcDeleteDataChannel(peer->channel_id);
|
||||
}
|
||||
|
||||
rtcDeletePeerConnection(peer->id);
|
||||
rtcDelete(peer->ws);
|
||||
NBN_Deallocator(peer);
|
||||
}
|
||||
|
||||
static void NBN_WebRTC_C_ProcessLocalDescription(NBN_WebRTC_C_Peer *peer, const char *sdp, const char *type)
|
||||
{
|
||||
char signaling_json[1024];
|
||||
char *escaped_sdp = NBN_WebRTC_C_EscapeSDP(sdp);
|
||||
|
||||
snprintf(signaling_json, sizeof(signaling_json), "{\"type\":\"%s\", \"sdp\":\"%s\"}", type, escaped_sdp);
|
||||
NBN_LogDebug("Send signaling message of type %s to remote connection: %s", type, signaling_json);
|
||||
|
||||
// pass -1 as the size (assume signaling_json to be a null-terminated string)
|
||||
if (rtcSendMessage(peer->ws, signaling_json, -1) < 0)
|
||||
{
|
||||
NBN_WebRTC_C_DestroyPeer(peer);
|
||||
}
|
||||
|
||||
NBN_Deallocator(escaped_sdp);
|
||||
}
|
||||
|
||||
static void NBN_WebRTC_C_ProcessSignalingMessage(NBN_WebRTC_C_Peer *peer, int ws, const char *msg, int size, const char *type)
|
||||
{
|
||||
// for some reason the size of the message is negative
|
||||
// in libdatachannel documentation (https://github.com/paullouisageneau/libdatachannel/blob/master/DOC.md) there is mention of:
|
||||
// size: if size >= 0, data is interpreted as a binary message of length size, otherwise it is interpreted as a null-terminated UTF-8 string.
|
||||
// so I guess in this case msg is a null terminated string? I could not find more information about this so I decided to go with
|
||||
// flipping the size to positive even though it feels weird, but it works so... ¯\_(ツ)_/¯
|
||||
|
||||
if (size < 0) size *= -1;
|
||||
size -= 1;
|
||||
|
||||
NBN_LogDebug("Received signaling message on WS %d (size: %d): %s", ws, size, msg);
|
||||
|
||||
char *sdp = NBN_WebRTC_C_ParseSignalingMessage(msg, size, type);
|
||||
|
||||
if (!sdp)
|
||||
{
|
||||
NBN_LogWarning("Failed to parse signaling data for WS %d", ws);
|
||||
return;
|
||||
}
|
||||
|
||||
NBN_LogDebug("Successfully parsed signaling payload (sdp: %s)", sdp);
|
||||
|
||||
int ret = rtcSetRemoteDescription(peer->id, sdp, type);
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
NBN_LogError("Failed to set remote description for peer %d (WS: %d): %d", peer->id, ws, ret);
|
||||
rtcClose(ws);
|
||||
}
|
||||
|
||||
// IMPORTANT: not sure I can free this because it's passed to rtcSetRemoteDescription
|
||||
NBN_Deallocator(sdp);
|
||||
}
|
||||
|
||||
#pragma endregion /* WebRTC common */
|
||||
|
||||
#pragma region Game server
|
||||
|
||||
typedef struct NBN_WebRTC_C_Server
|
||||
{
|
||||
int wsserver;
|
||||
NBN_WebRTC_C_HTable *peers;
|
||||
bool is_encrypted;
|
||||
pthread_t thread;
|
||||
uint16_t ws_port;
|
||||
uint32_t protocol_id;
|
||||
fio_tls_s *tls;
|
||||
char packet_buffer[NBN_PACKET_MAX_SIZE];
|
||||
} NBN_WebRTC_C_Server;
|
||||
|
||||
static NBN_WebRTC_C_Server nbn_wrtc_c_serv = {NULL, false, 0, 0, NULL, {0}};
|
||||
static NBN_WebRTC_C_Server nbn_wrtc_c_serv = {0, NULL, false, 0, 0, {0}};
|
||||
|
||||
static void NBN_WebRTC_C_DestroyPeer(NBN_WebRTC_C_Peer *peer)
|
||||
static void NBN_WebRTC_C_Serv_OnLocalDescription(int pc, const char *sdp, const char *type, void *user_ptr)
|
||||
{
|
||||
NBN_LogDebug("Destroy peer %d", peer->id);
|
||||
rtcClose(peer->channel_id);
|
||||
rtcDelete(peer->channel_id);
|
||||
rtcClosePeerConnection(peer->id);
|
||||
rtcDeletePeerConnection(peer->id);
|
||||
NBN_Deallocator(peer);
|
||||
NBN_LogDebug("Processing local description of type '%s'", type);
|
||||
|
||||
if (strncmp(type, "answer", strlen("answer")) != 0)
|
||||
{
|
||||
NBN_LogWarning("Ignoring local description of type '%s' (expected 'answer')", type);
|
||||
return;
|
||||
}
|
||||
|
||||
NBN_WebRTC_C_ProcessLocalDescription((NBN_WebRTC_C_Peer *)user_ptr, sdp, "answer");
|
||||
}
|
||||
|
||||
static void NBN_WebRTC_C_OnWsOpen(ws_s *ws)
|
||||
static void NBN_WebRTC_C_Serv_OnPeerStateChanged(int pc, rtcState state, void *user_ptr)
|
||||
{
|
||||
int peer_id = rtcCreatePeerConnection(&(rtcConfiguration){
|
||||
.iceServers = ice_servers,
|
||||
.iceServersCount = 1,
|
||||
.disableAutoNegotiation = false
|
||||
});
|
||||
NBN_LogDebug("Peer %d state changed to %d", pc, state);
|
||||
|
||||
if (peer_id < 0)
|
||||
if (state == RTC_CONNECTED)
|
||||
{
|
||||
NBN_LogError("Failed to create peer: %d", peer_id);
|
||||
NBN_WebRTC_C_Peer *peer = (NBN_WebRTC_C_Peer *)user_ptr;
|
||||
|
||||
NBN_Driver_RaiseEvent(NBN_DRIVER_SERV_CLIENT_CONNECTED, peer->conn);
|
||||
NBN_LogDebug("Peer %d is connected !", pc);
|
||||
}
|
||||
}
|
||||
|
||||
static void NBN_WebRTC_C_Serv_OnWsOpen(int ws, void *user_ptr)
|
||||
{
|
||||
NBN_LogDebug("WS %d is open", ws);
|
||||
|
||||
NBN_WebRTC_C_Peer *peer = NBN_WebRTC_C_CreatePeer(ws, NBN_WebRTC_C_Serv_OnLocalDescription, NBN_WebRTC_C_Serv_OnPeerStateChanged);
|
||||
|
||||
if (!peer)
|
||||
{
|
||||
NBN_LogError("Failed to create peer");
|
||||
return;
|
||||
}
|
||||
|
||||
// save a pointer to the WS in peer's user data
|
||||
rtcSetUserPointer(peer_id, ws);
|
||||
|
||||
int ret = rtcSetLocalDescriptionCallback(peer_id, NBN_WebRTC_C_OnLocalDescriptionCallback);
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
NBN_LogError("Failed to register local description callback for peer %d: %d", peer_id, ret);
|
||||
rtcClosePeerConnection(peer_id);
|
||||
rtcDeletePeerConnection(peer_id);
|
||||
return;
|
||||
}
|
||||
|
||||
int channel_id = rtcCreateDataChannelEx(peer_id, "unreliable", &(rtcDataChannelInit){
|
||||
.reliability = {.unordered = true, .unreliable = true, .maxPacketLifeTime = 1000, .maxRetransmits = 0},
|
||||
.negotiated = true,
|
||||
.manualStream = true,
|
||||
.stream = 0
|
||||
});
|
||||
|
||||
if (channel_id < 0)
|
||||
{
|
||||
NBN_LogError("Failed to create data channel for peer %d: %d", peer_id, channel_id);
|
||||
rtcClosePeerConnection(peer_id);
|
||||
rtcDeletePeerConnection(peer_id);
|
||||
return;
|
||||
}
|
||||
|
||||
NBN_LogDebug("Successfully created data channel for peer %d: %d", peer_id, channel_id);
|
||||
|
||||
NBN_WebRTC_C_Peer *peer = (NBN_WebRTC_C_Peer *)NBN_Allocator(sizeof(NBN_WebRTC_C_Peer));
|
||||
|
||||
peer->id = peer_id;
|
||||
peer->channel_id = channel_id;
|
||||
peer->ws = ws;
|
||||
peer->conn = NBN_GameServer_CreateClientConnection(
|
||||
NBN_WEBRTC_C_DRIVER_ID,
|
||||
peer,
|
||||
nbn_wrtc_c_serv.protocol_id,
|
||||
peer_id,
|
||||
peer->id,
|
||||
nbn_wrtc_c_serv.is_encrypted);
|
||||
|
||||
websocket_udata_set(ws, peer); // save a pointer to the peer in websocket's user data
|
||||
NBN_WebRTC_C_HTable_Add(nbn_wrtc_c_serv.peers, peer_id, peer);
|
||||
NBN_Driver_RaiseEvent(NBN_DRIVER_SERV_CLIENT_CONNECTED, peer->conn);
|
||||
NBN_WebRTC_C_HTable_Add(nbn_wrtc_c_serv.peers, peer->id, peer);
|
||||
}
|
||||
|
||||
static void NBN_WebRTC_C_OnWsClose(intptr_t uuid, void *udata)
|
||||
static void NBN_WebRTC_C_Serv_OnWsClosed(int ws, void *user_ptr)
|
||||
{
|
||||
if (uuid >= 0 && udata)
|
||||
{
|
||||
NBN_WebRTC_C_Peer *peer = udata;
|
||||
NBN_LogDebug("WS %d has closed", ws);
|
||||
|
||||
NBN_LogDebug("WebSocket %d closed (peer id %d)", uuid, peer->id);
|
||||
if (user_ptr)
|
||||
{
|
||||
NBN_WebRTC_C_Peer *peer = (NBN_WebRTC_C_Peer *)user_ptr;
|
||||
|
||||
NBN_LogDebug("Closing WebRTC peer and channel (peer: %d, channel: %d)", peer->id, peer->channel_id);
|
||||
|
||||
rtcClose(peer->channel_id);
|
||||
rtcClosePeerConnection(peer->id);
|
||||
}
|
||||
}
|
||||
|
||||
static void NBN_WebRTC_C_OnWsMessage(ws_s *ws, fio_str_info_s msg, uint8_t is_text)
|
||||
static void NBN_WebRTC_C_Serv_OnWsMessage(int ws, const char *msg, int size, void *user_ptr)
|
||||
{
|
||||
NBN_WebRTC_C_SignalingPayload payload;
|
||||
|
||||
bool ret = NBN_WebRTC_C_ParseSignalingMessage(msg.data, msg.len, &payload);
|
||||
|
||||
if (!ret) return;
|
||||
|
||||
if (payload.type == NBN_WEBRTC_C_OFFER && payload.sdp)
|
||||
{
|
||||
NBN_WebRTC_C_Peer *peer = websocket_udata_get(ws);
|
||||
|
||||
int ret = rtcSetRemoteDescription(peer->id, payload.sdp, "offer");
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
NBN_LogError("Failed to set remote description for peer %d: %d", peer->id, ret);
|
||||
}
|
||||
}
|
||||
|
||||
free(payload.json);
|
||||
NBN_WebRTC_C_ProcessSignalingMessage((NBN_WebRTC_C_Peer *)user_ptr, ws, msg, size, "offer");
|
||||
}
|
||||
|
||||
static void NBN_WebRTC_C_OnHttpRequest(http_s *request)
|
||||
static void NBN_WebRTC_C_Serv_OnWsConnection(int wsserver, int ws, void *user_ptr)
|
||||
{
|
||||
const char *msg = "This is a websocket server\n";
|
||||
NBN_LogDebug("New WS connection %d (user_ptr: %p)", ws, user_ptr);
|
||||
|
||||
http_set_header(request, HTTP_HEADER_CONTENT_TYPE, http_mimetype_find("txt", 3));
|
||||
http_send_body(request, (void *)msg, strlen(msg));
|
||||
}
|
||||
|
||||
static void NBN_WebRTC_C_OnHttpUpgrade(http_s *request, char *target, size_t len)
|
||||
{
|
||||
if (len >= 9 && target[1] == 'e')
|
||||
{
|
||||
http_upgrade2ws(
|
||||
request,
|
||||
.on_message = NBN_WebRTC_C_OnWsMessage,
|
||||
.on_open = NBN_WebRTC_C_OnWsOpen,
|
||||
.on_close = NBN_WebRTC_C_OnWsClose);
|
||||
}
|
||||
else if (len >= 3 && target[0] == 's')
|
||||
{
|
||||
http_upgrade2sse(request, .on_open = NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
http_send_error(request, 400);
|
||||
}
|
||||
}
|
||||
|
||||
static void *NBN_WebRTC_C_HttpServerThread(void *data)
|
||||
{
|
||||
char port_str[16];
|
||||
|
||||
snprintf(port_str, sizeof(port_str), "%d", nbn_wrtc_c_serv.ws_port);
|
||||
|
||||
if (http_listen(port_str, NULL,
|
||||
.tls = nbn_wrtc_c_serv.tls,
|
||||
.on_request = NBN_WebRTC_C_OnHttpRequest,
|
||||
.on_upgrade = NBN_WebRTC_C_OnHttpUpgrade) < 0)
|
||||
{
|
||||
NBN_LogError("Failed to start websocket server");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fio_start(.threads = 1);
|
||||
return NULL;
|
||||
rtcSetOpenCallback(ws, NBN_WebRTC_C_Serv_OnWsOpen);
|
||||
rtcSetClosedCallback(ws, NBN_WebRTC_C_Serv_OnWsClosed);
|
||||
rtcSetErrorCallback(ws, NBN_WebRTC_C_OnWsError);
|
||||
rtcSetMessageCallback(ws, NBN_WebRTC_C_Serv_OnWsMessage);
|
||||
}
|
||||
|
||||
static int NBN_WebRTC_C_ServStart(uint32_t protocol_id, uint16_t port, bool enable_encryption)
|
||||
{
|
||||
// protocol_id is not used
|
||||
|
||||
nbn_wrtc_c_serv.ws_port = port;
|
||||
nbn_wrtc_c_serv.peers = NBN_WebRTC_C_HTable_Create();
|
||||
nbn_wrtc_c_serv.is_encrypted = enable_encryption;
|
||||
nbn_wrtc_c_serv.protocol_id = protocol_id;
|
||||
nbn_wrtc_c_serv.tls = NULL;
|
||||
nbn_wrtc_c_serv.wsserver = -1;
|
||||
|
||||
#ifdef NBN_USE_HTTPS
|
||||
rtcInitLogger(nbn_wrtc_c_cfg.log_level, NBN_WebRTC_C_Log);
|
||||
rtcPreload();
|
||||
|
||||
nbn_wrtc_c_serv.tls = fio_tls_new(
|
||||
NBN_HTTPS_SERVER_NAME,
|
||||
NBN_HTTPS_CERT_PEM,
|
||||
NBN_HTTPS_KEY_PEM,
|
||||
NULL);
|
||||
rtcWsServerConfiguration cfg = {
|
||||
.port = port,
|
||||
.enableTls = nbn_wrtc_c_cfg.enable_tls,
|
||||
.certificatePemFile = nbn_wrtc_c_cfg.cert_path,
|
||||
.keyPemFile = nbn_wrtc_c_cfg.key_path,
|
||||
.keyPemPass = nbn_wrtc_c_cfg.passphrase
|
||||
};
|
||||
|
||||
NBN_LogDebug("Using HTTPS (server name: %s, cert: %s, key: %s)",
|
||||
NBN_HTTPS_SERVER_NAME, NBN_HTTPS_CERT_PEM, NBN_HTTPS_KEY_PEM);
|
||||
int wsserver = rtcCreateWebSocketServer(&cfg, NBN_WebRTC_C_Serv_OnWsConnection);
|
||||
|
||||
#endif // NBN_USE_HTTPS
|
||||
|
||||
if (pthread_create(&nbn_wrtc_c_serv.thread, NULL, NBN_WebRTC_C_HttpServerThread, nbn_wrtc_c_serv.tls) < 0)
|
||||
if (wsserver < 0)
|
||||
{
|
||||
NBN_LogError("Failed to start HTTP server thread");
|
||||
NBN_LogError("Failed to start WS server (code: %d)", wsserver);
|
||||
return NBN_ERROR;
|
||||
}
|
||||
|
||||
nbn_wrtc_c_serv.wsserver = wsserver;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void NBN_WebRTC_C_ServStop(void)
|
||||
{
|
||||
pthread_join(nbn_wrtc_c_serv.thread, NULL);
|
||||
NBN_WebRTC_C_HTable_Destroy(nbn_wrtc_c_serv.peers);
|
||||
rtcCleanup();
|
||||
|
||||
if (nbn_wrtc_c_serv.tls)
|
||||
if (nbn_wrtc_c_serv.wsserver >= 0)
|
||||
{
|
||||
fio_tls_destroy(nbn_wrtc_c_serv.tls);
|
||||
rtcDeleteWebSocketServer(nbn_wrtc_c_serv.wsserver);
|
||||
}
|
||||
|
||||
rtcCleanup();
|
||||
}
|
||||
|
||||
static int NBN_WebRTC_C_ServRecvPackets(void)
|
||||
{
|
||||
int size;
|
||||
const int buffer_size = sizeof(nbn_wrtc_c_serv.packet_buffer);
|
||||
int size = buffer_size;
|
||||
|
||||
for (unsigned int i = 0; i < nbn_wrtc_c_serv.peers->capacity; i++)
|
||||
{
|
||||
@@ -635,9 +693,7 @@ static int NBN_WebRTC_C_ServRecvPackets(void)
|
||||
|
||||
if (entry)
|
||||
{
|
||||
size = NBN_PACKET_MAX_SIZE;
|
||||
|
||||
while (rtcReceiveMessage(entry->peer->channel_id, nbn_wrtc_c_serv.packet_buffer, &size) != RTC_ERR_NOT_AVAIL)
|
||||
while (rtcReceiveMessage(entry->peer->channel_id, nbn_wrtc_c_serv.packet_buffer, &size) == RTC_ERR_SUCCESS)
|
||||
{
|
||||
NBN_Packet packet;
|
||||
|
||||
@@ -646,9 +702,11 @@ static int NBN_WebRTC_C_ServRecvPackets(void)
|
||||
|
||||
packet.sender = entry->peer->conn;
|
||||
NBN_Driver_RaiseEvent(NBN_DRIVER_SERV_CLIENT_PACKET_RECEIVED, &packet);
|
||||
size = buffer_size;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -668,7 +726,7 @@ static int NBN_WebRTC_C_ServSendPacketTo(NBN_Packet *packet, NBN_Connection *con
|
||||
|
||||
if (rtcSendMessage(peer->channel_id, (char *)packet->buffer, packet->size) < 0)
|
||||
{
|
||||
NBN_LogDebug("rtcSendMessage failed for peer %d", peer->id);
|
||||
NBN_LogError("rtcSendMessage failed for peer %d", peer->id);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -676,14 +734,225 @@ static int NBN_WebRTC_C_ServSendPacketTo(NBN_Packet *packet, NBN_Connection *con
|
||||
|
||||
#pragma endregion /* Game server */
|
||||
|
||||
void NBN_WebRTC_C_Register(void)
|
||||
#pragma region Game client
|
||||
|
||||
typedef struct NBN_WebRTC_C_Client
|
||||
{
|
||||
uint32_t protocol_id;
|
||||
bool is_encrypyed;
|
||||
bool is_connected;
|
||||
NBN_WebRTC_C_Peer *peer;
|
||||
char packet_buffer[NBN_PACKET_MAX_SIZE];
|
||||
} NBN_WebRTC_C_Client;
|
||||
|
||||
static NBN_WebRTC_C_Client nbn_wrtc_c_cli = (NBN_WebRTC_C_Client){0, false, false, NULL, {0}};
|
||||
|
||||
static void NBN_WebRTC_C_Cli_OnLocalDescription(int pc, const char *sdp, const char *type, void *user_ptr)
|
||||
{
|
||||
NBN_LogDebug("Processing local description of type '%s'", type);
|
||||
|
||||
if (strncmp(type, "offer", strlen("offer")) != 0)
|
||||
{
|
||||
NBN_LogWarning("Ignoring local description of type '%s' (expected 'offer')", type);
|
||||
return;
|
||||
}
|
||||
|
||||
NBN_WebRTC_C_ProcessLocalDescription((NBN_WebRTC_C_Peer *)user_ptr, sdp, "offer");
|
||||
}
|
||||
|
||||
static void NBN_WebRTC_C_Cli_OnPeerStateChanged(int pc, rtcState state, void *user_ptr)
|
||||
{
|
||||
NBN_LogDebug("Server peer state changed to %d", pc, state);
|
||||
|
||||
if (state == RTC_CONNECTED)
|
||||
{
|
||||
NBN_WebRTC_C_Peer *peer = (NBN_WebRTC_C_Peer *)user_ptr;
|
||||
|
||||
NBN_LogDebug("Server peer is connected !", pc);
|
||||
nbn_wrtc_c_cli.is_connected = true;
|
||||
}
|
||||
}
|
||||
|
||||
static void NBN_WebRTC_C_Cli_OnWsOpen(int ws, void *user_ptr)
|
||||
{
|
||||
NBN_LogDebug("WS %d is open, creating peer...", ws);
|
||||
|
||||
NBN_WebRTC_C_Peer *peer = NBN_WebRTC_C_CreatePeer(ws, NBN_WebRTC_C_Cli_OnLocalDescription, NBN_WebRTC_C_Cli_OnPeerStateChanged);
|
||||
|
||||
if (!peer)
|
||||
{
|
||||
NBN_LogError("Failed to create peer");
|
||||
return;
|
||||
}
|
||||
|
||||
NBN_LogDebug("Successfully created peer: %d", peer->id);
|
||||
|
||||
peer->conn = NBN_GameClient_CreateServerConnection(NBN_WEBRTC_C_DRIVER_ID, peer, nbn_wrtc_c_cli.protocol_id, nbn_wrtc_c_cli.is_encrypyed);
|
||||
nbn_wrtc_c_cli.peer = peer;
|
||||
}
|
||||
|
||||
static void NBN_WebRTC_C_Cli_OnWsClosed(int ws, void *user_ptr)
|
||||
{
|
||||
NBN_LogDebug("WS %d has closed", ws);
|
||||
|
||||
if (user_ptr)
|
||||
{
|
||||
NBN_WebRTC_C_Peer *peer = (NBN_WebRTC_C_Peer *)user_ptr;
|
||||
|
||||
NBN_LogDebug("Destroying server peer (peer: %d, channel: %d)", peer->id, peer->channel_id);
|
||||
NBN_WebRTC_C_DestroyPeer(peer);
|
||||
}
|
||||
}
|
||||
|
||||
static void NBN_WebRTC_C_Cli_OnWsMessage(int ws, const char *msg, int size, void *user_ptr)
|
||||
{
|
||||
NBN_WebRTC_C_ProcessSignalingMessage((NBN_WebRTC_C_Peer *)user_ptr, ws, msg, size, "answer");
|
||||
}
|
||||
|
||||
static int AttemptConnection(void)
|
||||
{
|
||||
struct timespec rqtp;
|
||||
|
||||
rqtp.tv_sec = 0;
|
||||
rqtp.tv_nsec = 1e9 / 3;
|
||||
|
||||
int retries = 9; // approximatively 3 seconds to get connected
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (nanosleep(&rqtp, NULL) < 0)
|
||||
{
|
||||
NBN_LogError("nanosleep failed");
|
||||
return NBN_ERROR;
|
||||
}
|
||||
|
||||
if (--retries <= 0 || nbn_wrtc_c_cli.is_connected)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!nbn_wrtc_c_cli.is_connected)
|
||||
{
|
||||
NBN_LogError("Failed to connect");
|
||||
|
||||
return NBN_ERROR;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int NBN_WebRTC_C_CliStart(uint32_t protocol_id, const char *host, uint16_t port, bool enable_encryption)
|
||||
{
|
||||
rtcInitLogger(nbn_wrtc_c_cfg.log_level, NBN_WebRTC_C_Log);
|
||||
rtcPreload();
|
||||
|
||||
char ws_addr[256] = {0};
|
||||
|
||||
snprintf(ws_addr, sizeof(ws_addr), "ws://%s:%d", host, port);
|
||||
|
||||
int cli_ws;
|
||||
|
||||
if ((cli_ws = rtcCreateWebSocket(ws_addr)) < 0)
|
||||
{
|
||||
NBN_LogError("Failed to create websocket");
|
||||
return NBN_ERROR;
|
||||
}
|
||||
|
||||
nbn_wrtc_c_cli.protocol_id = protocol_id;
|
||||
nbn_wrtc_c_cli.is_encrypyed = enable_encryption;
|
||||
|
||||
NBN_LogDebug("Successfully created client WS: %d", cli_ws);
|
||||
|
||||
rtcSetOpenCallback(cli_ws, NBN_WebRTC_C_Cli_OnWsOpen);
|
||||
rtcSetClosedCallback(cli_ws, NBN_WebRTC_C_Cli_OnWsClosed);
|
||||
rtcSetErrorCallback(cli_ws, NBN_WebRTC_C_OnWsError);
|
||||
rtcSetMessageCallback(cli_ws, NBN_WebRTC_C_Cli_OnWsMessage);
|
||||
|
||||
return AttemptConnection();
|
||||
}
|
||||
|
||||
static void NBN_WebRTC_C_CliStop(void)
|
||||
{
|
||||
NBN_WebRTC_C_Peer *peer = nbn_wrtc_c_cli.peer;
|
||||
|
||||
if (peer)
|
||||
{
|
||||
NBN_WebRTC_C_DestroyPeer(peer);
|
||||
}
|
||||
|
||||
nbn_wrtc_c_cli.is_connected = false;
|
||||
rtcCleanup();
|
||||
}
|
||||
|
||||
static int NBN_WebRTC_C_CliRecvPackets(void)
|
||||
{
|
||||
const int buffer_size = sizeof(nbn_wrtc_c_cli.packet_buffer);
|
||||
int size = buffer_size;
|
||||
NBN_WebRTC_C_Peer *peer = nbn_wrtc_c_cli.peer;
|
||||
|
||||
while (rtcReceiveMessage(peer->channel_id, nbn_wrtc_c_cli.packet_buffer, &size) == RTC_ERR_SUCCESS)
|
||||
{
|
||||
NBN_Packet packet;
|
||||
|
||||
if (NBN_Packet_InitRead(&packet, peer->conn, (uint8_t *)nbn_wrtc_c_cli.packet_buffer, size) < 0)
|
||||
continue;
|
||||
|
||||
packet.sender = peer->conn;
|
||||
NBN_Driver_RaiseEvent(NBN_DRIVER_CLI_PACKET_RECEIVED, &packet);
|
||||
size = buffer_size;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int NBN_WebRTC_C_CliSendPacket(NBN_Packet *packet)
|
||||
{
|
||||
NBN_WebRTC_C_Peer *peer = nbn_wrtc_c_cli.peer;
|
||||
|
||||
if (rtcSendMessage(peer->channel_id, (char *)packet->buffer, packet->size) < 0)
|
||||
{
|
||||
NBN_LogError("rtcSendMessage failed for peer %d", peer->id);
|
||||
return NBN_ERROR;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#pragma endregion /* Game client */
|
||||
|
||||
void NBN_WebRTC_C_Register(NBN_WebRTC_C_Config config)
|
||||
{
|
||||
const char **ice_servers = NBN_Allocator(sizeof(char *) * config.ice_servers_count);
|
||||
|
||||
for (unsigned int i = 0; i < config.ice_servers_count; i++)
|
||||
{
|
||||
// strdup equivalent using NBN_Allocator, make sure this get freed
|
||||
const char *str = config.ice_servers[i];
|
||||
size_t len = strlen(str);
|
||||
char *dup_str = NBN_Allocator(len + 1);
|
||||
|
||||
memcpy(dup_str, str, len + 1);
|
||||
ice_servers[i] = dup_str;
|
||||
}
|
||||
|
||||
nbn_wrtc_c_cfg.ice_servers = ice_servers;
|
||||
nbn_wrtc_c_cfg.ice_servers_count = config.ice_servers_count;
|
||||
nbn_wrtc_c_cfg.enable_tls = config.enable_tls;
|
||||
|
||||
if (config.enable_tls)
|
||||
{
|
||||
nbn_wrtc_c_cfg.cert_path = config.cert_path;
|
||||
nbn_wrtc_c_cfg.key_path = config.key_path;
|
||||
nbn_wrtc_c_cfg.passphrase = config.passphrase;
|
||||
}
|
||||
|
||||
NBN_DriverImplementation driver_impl = {
|
||||
// Client implementation
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NBN_WebRTC_C_CliStart,
|
||||
NBN_WebRTC_C_CliStop,
|
||||
NBN_WebRTC_C_CliRecvPackets,
|
||||
NBN_WebRTC_C_CliSendPacket,
|
||||
|
||||
// Server implementation
|
||||
NBN_WebRTC_C_ServStart,
|
||||
@@ -693,11 +962,17 @@ void NBN_WebRTC_C_Register(void)
|
||||
NBN_WebRTC_C_ServRemoveClientConnection
|
||||
};
|
||||
|
||||
NBN_Driver_Register(
|
||||
NBN_WEBRTC_C_DRIVER_ID,
|
||||
NBN_WEBRTC_C_DRIVER_NAME,
|
||||
driver_impl
|
||||
);
|
||||
NBN_Driver_Register(NBN_WEBRTC_C_DRIVER_ID, NBN_WEBRTC_C_DRIVER_NAME, driver_impl);
|
||||
}
|
||||
|
||||
void NBN_WebRTC_C_Unregister(void)
|
||||
{
|
||||
for (unsigned int i = 0; i < nbn_wrtc_c_cfg.ice_servers_count; i++)
|
||||
{
|
||||
NBN_Deallocator((void *)nbn_wrtc_c_cfg.ice_servers[i]);
|
||||
}
|
||||
|
||||
NBN_Deallocator(nbn_wrtc_c_cfg.ice_servers);
|
||||
}
|
||||
|
||||
#endif // NBNET_IMPL
|
||||
+10
-37
@@ -20,56 +20,29 @@ add_compile_options(-Wall -Wextra -Wpedantic)
|
||||
target_compile_definitions(client PUBLIC NBN_DEBUG NBN_DISABLE_STALE_CONNECTION_DETECTION NBN_USE_PACKET_SIMULATOR SOAK_CLIENT)
|
||||
target_compile_definitions(server PUBLIC NBN_DEBUG NBN_DISABLE_STALE_CONNECTION_DETECTION NBN_USE_PACKET_SIMULATOR SOAK_SERVER)
|
||||
|
||||
option(ENCRYPTION_ENABLED OFF)
|
||||
option(WEBRTC_DRIVER_C OFF)
|
||||
|
||||
if (ENCRYPTION_ENABLED)
|
||||
message("Encryption enabled")
|
||||
|
||||
target_compile_definitions(client PUBLIC SOAK_ENCRYPTION)
|
||||
target_compile_definitions(server PUBLIC SOAK_ENCRYPTION)
|
||||
endif(ENCRYPTION_ENABLED)
|
||||
|
||||
unset(ENCRYPTION_ENABLED)
|
||||
option(WEBRTC_NATIVE OFF)
|
||||
|
||||
# compile with C WebRTC driver
|
||||
if (WEBRTC_C_DRIVER)
|
||||
if (WEBRTC_NATIVE)
|
||||
# can't compile WebRTC native driver with emscripten
|
||||
if (EMSCRIPTEN)
|
||||
message(SEND_ERROR "Can't compile WebRTC native driver with emscripten")
|
||||
endif (EMSCRIPTEN)
|
||||
|
||||
message("Compiling with C WebRTC driver")
|
||||
message("Compiling with WebRTC native driver")
|
||||
|
||||
target_compile_definitions(server PUBLIC SOAK_WEBRTC_C_DRIVER)
|
||||
target_compile_definitions(server PUBLIC WEBRTC_NATIVE)
|
||||
target_compile_definitions(client PUBLIC WEBRTC_NATIVE)
|
||||
|
||||
target_link_libraries(server ${LIBFACILIO_LIBRARY_PATH})
|
||||
target_link_libraries(server ${LIBCRYPTO_LIBRARY_PATH})
|
||||
target_link_libraries(server ${LIBSSL_LIBRARY_PATH})
|
||||
target_link_libraries(server ${LIBDATACHANNEL_LIBRARY_PATH})
|
||||
target_link_libraries(server ${LIBDATACHANNEL_LIBRARY_PATH} m)
|
||||
target_link_libraries(client ${LIBDATACHANNEL_LIBRARY_PATH} m)
|
||||
|
||||
target_include_directories(server PUBLIC "${LIBFACILIO_INCLUDE_PATH}")
|
||||
target_include_directories(server PUBLIC "${OPENSSL_INCLUDE_PATH}")
|
||||
target_include_directories(server PUBLIC "${LIBDATACHANNEL_INCLUDE_PATH}")
|
||||
target_include_directories(client PUBLIC "${LIBDATACHANNEL_INCLUDE_PATH}")
|
||||
|
||||
if (USE_HTTPS)
|
||||
target_compile_definitions(server PUBLIC NBN_HTTPS_SERVER_NAME="localhost")
|
||||
target_compile_definitions(server PUBLIC NBN_HTTPS_KEY_PEM="localhost.key")
|
||||
target_compile_definitions(server PUBLIC NBN_HTTPS_CERT_PEM="localhost.crt")
|
||||
endif (USE_HTTPS)
|
||||
endif (WEBRTC_C_DRIVER)
|
||||
endif (WEBRTC_NATIVE)
|
||||
|
||||
unset(WEBRTC_C_DRIVER)
|
||||
|
||||
# Use HTTPS (for WebRTC drivers)
|
||||
if (USE_HTTPS)
|
||||
message("Compiling with HTTPS enabled")
|
||||
|
||||
target_compile_definitions(client PUBLIC NBN_USE_HTTPS)
|
||||
target_compile_definitions(server PUBLIC NBN_USE_HTTPS)
|
||||
endif (USE_HTTPS)
|
||||
|
||||
unset(USE_HTTPS)
|
||||
unset(WEBRTC_NATIVE)
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(client wsock32 ws2_32)
|
||||
|
||||
+52
-5
@@ -26,13 +26,19 @@
|
||||
#include "soak.h"
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
/* Use WebRTC driver */
|
||||
|
||||
#include "../net_drivers/webrtc.h"
|
||||
|
||||
#else
|
||||
/* Use UDP driver */
|
||||
|
||||
#include "../net_drivers/udp.h"
|
||||
|
||||
#ifdef WEBRTC_NATIVE
|
||||
#include "../net_drivers/webrtc_c.h"
|
||||
#endif
|
||||
|
||||
#endif // __EMSCRIPTEN__
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t data[SOAK_MESSAGE_MAX_DATA_LENGTH];
|
||||
@@ -270,10 +276,43 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
Soak_SetLogLevel(LOG_TRACE);
|
||||
|
||||
if (Soak_ReadCommandLine(argc, argv) < 0)
|
||||
return -1;
|
||||
|
||||
SoakOptions options = Soak_GetOptions();
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
NBN_WebRTC_Register(); // Register the WebRTC driver
|
||||
NBN_WebRTC_Register((NBN_WebRTC_Config){.enable_tls = false}); // Register the WebRTC driver
|
||||
#else
|
||||
NBN_UDP_Register(); // Register the UDP driver
|
||||
|
||||
#ifdef WEBRTC_NATIVE
|
||||
|
||||
if (options.webrtc)
|
||||
{
|
||||
// Register native WebRTC driver
|
||||
const char *ice_servers[] = { "stun:stun01.sipphone.com" };
|
||||
NBN_WebRTC_C_Config cfg = {
|
||||
.ice_servers = ice_servers,
|
||||
.ice_servers_count = 1,
|
||||
.enable_tls = false,
|
||||
.cert_path = NULL,
|
||||
.key_path = NULL,
|
||||
.passphrase = NULL,
|
||||
.log_level = RTC_LOG_VERBOSE};
|
||||
|
||||
NBN_WebRTC_C_Register(cfg);
|
||||
}
|
||||
else
|
||||
{
|
||||
NBN_UDP_Register();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
NBN_UDP_Register();
|
||||
|
||||
#endif // WEBRTC_NATIVE
|
||||
|
||||
#endif // __EMSCRIPTEN__
|
||||
|
||||
if (NBN_GameClient_Start(SOAK_PROTOCOL_NAME, "127.0.0.1", SOAK_PORT) < 0)
|
||||
@@ -293,7 +332,6 @@ int main(int argc, char *argv[])
|
||||
return 1;
|
||||
}
|
||||
|
||||
SoakOptions options = Soak_GetOptions();
|
||||
unsigned int channel_count = options.channel_count;
|
||||
unsigned int message_count = options.message_count;
|
||||
unsigned int message_per_channel = message_count / channel_count;
|
||||
@@ -349,6 +387,15 @@ int main(int argc, char *argv[])
|
||||
|
||||
Soak_LogInfo("No memory leak detected! Cool... cool cool cool");
|
||||
|
||||
#ifdef WEBRTC_NATIVE
|
||||
|
||||
if (options.webrtc)
|
||||
{
|
||||
NBN_WebRTC_C_Unregister();
|
||||
}
|
||||
|
||||
#endif // WEBRTC_NATIVE
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
emscripten_force_exit(ret);
|
||||
#else
|
||||
|
||||
Generated
+872
-9
@@ -1,6 +1,869 @@
|
||||
{
|
||||
"name": "soak",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"lockfileVersion": 1,
|
||||
"packages": {
|
||||
"": {
|
||||
"dependencies": {
|
||||
"nbnet": "file:../net_drivers/webrtc"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc": {
|
||||
"name": "nbnet",
|
||||
"version": "1.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"websocket": "^1.0.31",
|
||||
"winston": "^3.2.1",
|
||||
"wrtc": "^0.4.2"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/@dabh/diagnostics": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.2.tgz",
|
||||
"integrity": "sha512-+A1YivoVDNNVCdfozHSR8v/jyuuLTMXwjWuxPFlFlUapXoGc+Gj9mDlTDDfrwl7rXCl2tNZ0kE8sIBO6YOn96Q==",
|
||||
"dependencies": {
|
||||
"colorspace": "1.1.x",
|
||||
"enabled": "2.0.x",
|
||||
"kuler": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/abbrev": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
|
||||
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/ansi-regex": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
|
||||
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/aproba": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz",
|
||||
"integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw=="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/are-we-there-yet": {
|
||||
"version": "1.1.5",
|
||||
"resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz",
|
||||
"integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==",
|
||||
"dependencies": {
|
||||
"delegates": "^1.0.0",
|
||||
"readable-stream": "^2.0.6"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/are-we-there-yet/node_modules/readable-stream": {
|
||||
"version": "2.3.7",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
|
||||
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
|
||||
"dependencies": {
|
||||
"core-util-is": "~1.0.0",
|
||||
"inherits": "~2.0.3",
|
||||
"isarray": "~1.0.0",
|
||||
"process-nextick-args": "~2.0.0",
|
||||
"safe-buffer": "~5.1.1",
|
||||
"string_decoder": "~1.1.1",
|
||||
"util-deprecate": "~1.0.1"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/are-we-there-yet/node_modules/safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/are-we-there-yet/node_modules/string_decoder": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
|
||||
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
|
||||
"dependencies": {
|
||||
"safe-buffer": "~5.1.0"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/async": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz",
|
||||
"integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw=="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/balanced-match": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/bufferutil": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.1.tgz",
|
||||
"integrity": "sha512-xowrxvpxojqkagPcWRQVXZl0YXhRhAtBEIq3VoER1NH5Mw1n1o0ojdspp+GS2J//2gCVyrzQDApQ4unGF+QOoA==",
|
||||
"dependencies": {
|
||||
"node-gyp-build": "~3.7.0"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/chownr": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
|
||||
"integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg=="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/code-point-at": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
|
||||
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/color": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/color/-/color-3.0.0.tgz",
|
||||
"integrity": "sha512-jCpd5+s0s0t7p3pHQKpnJ0TpQKKdleP71LWcA0aqiljpiuAkOSUFN/dyH8ZwF0hRmFlrIuRhufds1QyEP9EB+w==",
|
||||
"dependencies": {
|
||||
"color-convert": "^1.9.1",
|
||||
"color-string": "^1.5.2"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/color-convert": {
|
||||
"version": "1.9.3",
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
|
||||
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
|
||||
"dependencies": {
|
||||
"color-name": "1.1.3"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/color-name": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
|
||||
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/color-string": {
|
||||
"version": "1.5.3",
|
||||
"resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.3.tgz",
|
||||
"integrity": "sha512-dC2C5qeWoYkxki5UAXapdjqO672AM4vZuPGRQfO8b5HKuKGBbKWpITyDYN7TOFKvRW7kOgAn3746clDBMDJyQw==",
|
||||
"dependencies": {
|
||||
"color-name": "^1.0.0",
|
||||
"simple-swizzle": "^0.2.2"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/colors": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz",
|
||||
"integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA=="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/colorspace": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.2.tgz",
|
||||
"integrity": "sha512-vt+OoIP2d76xLhjwbBaucYlNSpPsrJWPlBTtwCpQKIu6/CSMutyzX93O/Do0qzpH3YoHEes8YEFXyZ797rEhzQ==",
|
||||
"dependencies": {
|
||||
"color": "3.0.x",
|
||||
"text-hex": "1.0.x"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/console-control-strings": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
|
||||
"integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/core-util-is": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
|
||||
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/d": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz",
|
||||
"integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==",
|
||||
"dependencies": {
|
||||
"es5-ext": "^0.10.50",
|
||||
"type": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/debug": {
|
||||
"version": "2.6.9",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
||||
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
||||
"dependencies": {
|
||||
"ms": "2.0.0"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/deep-extend": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
|
||||
"integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA=="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/delegates": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
|
||||
"integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/detect-libc": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz",
|
||||
"integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/domexception": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz",
|
||||
"integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"webidl-conversions": "^4.0.2"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/enabled": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz",
|
||||
"integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ=="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/es5-ext": {
|
||||
"version": "0.10.53",
|
||||
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz",
|
||||
"integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==",
|
||||
"dependencies": {
|
||||
"es6-iterator": "~2.0.3",
|
||||
"es6-symbol": "~3.1.3",
|
||||
"next-tick": "~1.0.0"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/es6-iterator": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz",
|
||||
"integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=",
|
||||
"dependencies": {
|
||||
"d": "1",
|
||||
"es5-ext": "^0.10.35",
|
||||
"es6-symbol": "^3.1.1"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/es6-symbol": {
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz",
|
||||
"integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==",
|
||||
"dependencies": {
|
||||
"d": "^1.0.1",
|
||||
"ext": "^1.1.2"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/ext": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz",
|
||||
"integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==",
|
||||
"dependencies": {
|
||||
"type": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/ext/node_modules/type": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/type/-/type-2.1.0.tgz",
|
||||
"integrity": "sha512-G9absDWvhAWCV2gmF1zKud3OyC61nZDwWvBL2DApaVFogI07CprggiQAOOjvp2NRjYWFzPyu7vwtDrQFq8jeSA=="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/fast-safe-stringify": {
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz",
|
||||
"integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA=="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/fecha": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.0.tgz",
|
||||
"integrity": "sha512-aN3pcx/DSmtyoovUudctc8+6Hl4T+hI9GBBHLjA76jdZl7+b1sgh5g4k+u/GL3dTy1/pnYzKp69FpJ0OicE3Wg=="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/fn.name": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz",
|
||||
"integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw=="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/fs-minipass": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz",
|
||||
"integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==",
|
||||
"dependencies": {
|
||||
"minipass": "^2.6.0"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/gauge": {
|
||||
"version": "2.7.4",
|
||||
"resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz",
|
||||
"integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=",
|
||||
"dependencies": {
|
||||
"aproba": "^1.0.3",
|
||||
"console-control-strings": "^1.0.0",
|
||||
"has-unicode": "^2.0.0",
|
||||
"object-assign": "^4.1.0",
|
||||
"signal-exit": "^3.0.0",
|
||||
"string-width": "^1.0.1",
|
||||
"strip-ansi": "^3.0.1",
|
||||
"wide-align": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/glob": {
|
||||
"version": "7.1.6",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
|
||||
"integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
|
||||
"dependencies": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^3.0.4",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/has-unicode": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
|
||||
"integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/iconv-lite": {
|
||||
"version": "0.4.24",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
|
||||
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
|
||||
"dependencies": {
|
||||
"safer-buffer": ">= 2.1.2 < 3"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/ignore-walk": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.3.tgz",
|
||||
"integrity": "sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw==",
|
||||
"dependencies": {
|
||||
"minimatch": "^3.0.4"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/inflight": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
||||
"dependencies": {
|
||||
"once": "^1.3.0",
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/ini": {
|
||||
"version": "1.3.5",
|
||||
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
|
||||
"integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw=="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/is-arrayish": {
|
||||
"version": "0.3.2",
|
||||
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz",
|
||||
"integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ=="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/is-fullwidth-code-point": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
|
||||
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
|
||||
"dependencies": {
|
||||
"number-is-nan": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/is-stream": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz",
|
||||
"integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw=="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/is-typedarray": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
|
||||
"integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/isarray": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
|
||||
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/kuler": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz",
|
||||
"integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A=="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/logform": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/logform/-/logform-2.2.0.tgz",
|
||||
"integrity": "sha512-N0qPlqfypFx7UHNn4B3lzS/b0uLqt2hmuoa+PpuXNYgozdJYAyauF5Ky0BWVjrxDlMWiT3qN4zPq3vVAfZy7Yg==",
|
||||
"dependencies": {
|
||||
"colors": "^1.2.1",
|
||||
"fast-safe-stringify": "^2.0.4",
|
||||
"fecha": "^4.2.0",
|
||||
"ms": "^2.1.1",
|
||||
"triple-beam": "^1.3.0"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/logform/node_modules/ms": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/minimatch": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/minimist": {
|
||||
"version": "1.2.5",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
|
||||
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/minipass": {
|
||||
"version": "2.9.0",
|
||||
"resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz",
|
||||
"integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==",
|
||||
"dependencies": {
|
||||
"safe-buffer": "^5.1.2",
|
||||
"yallist": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/minizlib": {
|
||||
"version": "1.3.3",
|
||||
"resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz",
|
||||
"integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==",
|
||||
"dependencies": {
|
||||
"minipass": "^2.9.0"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/mkdirp": {
|
||||
"version": "0.5.5",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
|
||||
"integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
|
||||
"dependencies": {
|
||||
"minimist": "^1.2.5"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/ms": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
||||
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/needle": {
|
||||
"version": "2.5.2",
|
||||
"resolved": "https://registry.npmjs.org/needle/-/needle-2.5.2.tgz",
|
||||
"integrity": "sha512-LbRIwS9BfkPvNwNHlsA41Q29kL2L/6VaOJ0qisM5lLWsTV3nP15abO5ITL6L81zqFhzjRKDAYjpcBcwM0AVvLQ==",
|
||||
"dependencies": {
|
||||
"debug": "^3.2.6",
|
||||
"iconv-lite": "^0.4.4",
|
||||
"sax": "^1.2.4"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/needle/node_modules/debug": {
|
||||
"version": "3.2.6",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
|
||||
"integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
|
||||
"dependencies": {
|
||||
"ms": "^2.1.1"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/needle/node_modules/ms": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/next-tick": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz",
|
||||
"integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/node-gyp-build": {
|
||||
"version": "3.7.0",
|
||||
"resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-3.7.0.tgz",
|
||||
"integrity": "sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w=="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/node-pre-gyp": {
|
||||
"version": "0.13.0",
|
||||
"resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.13.0.tgz",
|
||||
"integrity": "sha512-Md1D3xnEne8b/HGVQkZZwV27WUi1ZRuZBij24TNaZwUPU3ZAFtvT6xxJGaUVillfmMKnn5oD1HoGsp2Ftik7SQ==",
|
||||
"dependencies": {
|
||||
"detect-libc": "^1.0.2",
|
||||
"mkdirp": "^0.5.1",
|
||||
"needle": "^2.2.1",
|
||||
"nopt": "^4.0.1",
|
||||
"npm-packlist": "^1.1.6",
|
||||
"npmlog": "^4.0.2",
|
||||
"rc": "^1.2.7",
|
||||
"rimraf": "^2.6.1",
|
||||
"semver": "^5.3.0",
|
||||
"tar": "^4"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/nopt": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz",
|
||||
"integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==",
|
||||
"dependencies": {
|
||||
"abbrev": "1",
|
||||
"osenv": "^0.1.4"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/npm-bundled": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.1.tgz",
|
||||
"integrity": "sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA==",
|
||||
"dependencies": {
|
||||
"npm-normalize-package-bin": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/npm-normalize-package-bin": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz",
|
||||
"integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA=="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/npm-packlist": {
|
||||
"version": "1.4.8",
|
||||
"resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.8.tgz",
|
||||
"integrity": "sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A==",
|
||||
"dependencies": {
|
||||
"ignore-walk": "^3.0.1",
|
||||
"npm-bundled": "^1.0.1",
|
||||
"npm-normalize-package-bin": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/npmlog": {
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz",
|
||||
"integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==",
|
||||
"dependencies": {
|
||||
"are-we-there-yet": "~1.1.2",
|
||||
"console-control-strings": "~1.1.0",
|
||||
"gauge": "~2.7.3",
|
||||
"set-blocking": "~2.0.0"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/number-is-nan": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
|
||||
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/object-assign": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
||||
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||
"dependencies": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/one-time": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz",
|
||||
"integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==",
|
||||
"dependencies": {
|
||||
"fn.name": "1.x.x"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/os-homedir": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
|
||||
"integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/os-tmpdir": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
|
||||
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/osenv": {
|
||||
"version": "0.1.5",
|
||||
"resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz",
|
||||
"integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==",
|
||||
"dependencies": {
|
||||
"os-homedir": "^1.0.0",
|
||||
"os-tmpdir": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/process-nextick-args": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
||||
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/rc": {
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz",
|
||||
"integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==",
|
||||
"dependencies": {
|
||||
"deep-extend": "^0.6.0",
|
||||
"ini": "~1.3.0",
|
||||
"minimist": "^1.2.0",
|
||||
"strip-json-comments": "~2.0.1"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/readable-stream": {
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
|
||||
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
|
||||
"dependencies": {
|
||||
"inherits": "^2.0.3",
|
||||
"string_decoder": "^1.1.1",
|
||||
"util-deprecate": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/rimraf": {
|
||||
"version": "2.7.1",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
|
||||
"integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
|
||||
"dependencies": {
|
||||
"glob": "^7.1.3"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/safe-buffer": {
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
||||
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/sax": {
|
||||
"version": "1.2.4",
|
||||
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
|
||||
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/semver": {
|
||||
"version": "5.7.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
|
||||
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ=="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/set-blocking": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
|
||||
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/signal-exit": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz",
|
||||
"integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA=="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/simple-swizzle": {
|
||||
"version": "0.2.2",
|
||||
"resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz",
|
||||
"integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=",
|
||||
"dependencies": {
|
||||
"is-arrayish": "^0.3.1"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/stack-trace": {
|
||||
"version": "0.0.10",
|
||||
"resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz",
|
||||
"integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/string_decoder": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
|
||||
"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
|
||||
"dependencies": {
|
||||
"safe-buffer": "~5.2.0"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/string-width": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
|
||||
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
|
||||
"dependencies": {
|
||||
"code-point-at": "^1.0.0",
|
||||
"is-fullwidth-code-point": "^1.0.0",
|
||||
"strip-ansi": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/strip-ansi": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
|
||||
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
|
||||
"dependencies": {
|
||||
"ansi-regex": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/strip-json-comments": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
|
||||
"integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/tar": {
|
||||
"version": "4.4.13",
|
||||
"resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz",
|
||||
"integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==",
|
||||
"dependencies": {
|
||||
"chownr": "^1.1.1",
|
||||
"fs-minipass": "^1.2.5",
|
||||
"minipass": "^2.8.6",
|
||||
"minizlib": "^1.2.1",
|
||||
"mkdirp": "^0.5.0",
|
||||
"safe-buffer": "^5.1.2",
|
||||
"yallist": "^3.0.3"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/text-hex": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz",
|
||||
"integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg=="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/triple-beam": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz",
|
||||
"integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw=="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/type": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz",
|
||||
"integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg=="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/typedarray-to-buffer": {
|
||||
"version": "3.1.5",
|
||||
"resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz",
|
||||
"integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==",
|
||||
"dependencies": {
|
||||
"is-typedarray": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/utf-8-validate": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.2.tgz",
|
||||
"integrity": "sha512-SwV++i2gTD5qh2XqaPzBnNX88N6HdyhQrNNRykvcS0QKvItV9u3vPEJr+X5Hhfb1JC0r0e1alL0iB09rY8+nmw==",
|
||||
"dependencies": {
|
||||
"node-gyp-build": "~3.7.0"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/webidl-conversions": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz",
|
||||
"integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==",
|
||||
"optional": true
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/websocket": {
|
||||
"version": "1.0.32",
|
||||
"resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.32.tgz",
|
||||
"integrity": "sha512-i4yhcllSP4wrpoPMU2N0TQ/q0O94LRG/eUQjEAamRltjQ1oT1PFFKOG4i877OlJgCG8rw6LrrowJp+TYCEWF7Q==",
|
||||
"dependencies": {
|
||||
"bufferutil": "^4.0.1",
|
||||
"debug": "^2.2.0",
|
||||
"es5-ext": "^0.10.50",
|
||||
"typedarray-to-buffer": "^3.1.5",
|
||||
"utf-8-validate": "^5.0.2",
|
||||
"yaeti": "^0.0.6"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/wide-align": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz",
|
||||
"integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==",
|
||||
"dependencies": {
|
||||
"string-width": "^1.0.2 || 2"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/winston": {
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/winston/-/winston-3.3.3.tgz",
|
||||
"integrity": "sha512-oEXTISQnC8VlSAKf1KYSSd7J6IWuRPQqDdo8eoRNaYKLvwSb5+79Z3Yi1lrl6KDpU6/VWaxpakDAtb1oQ4n9aw==",
|
||||
"dependencies": {
|
||||
"@dabh/diagnostics": "^2.0.2",
|
||||
"async": "^3.1.0",
|
||||
"is-stream": "^2.0.0",
|
||||
"logform": "^2.2.0",
|
||||
"one-time": "^1.0.0",
|
||||
"readable-stream": "^3.4.0",
|
||||
"stack-trace": "0.0.x",
|
||||
"triple-beam": "^1.3.0",
|
||||
"winston-transport": "^4.4.0"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/winston-transport": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.4.0.tgz",
|
||||
"integrity": "sha512-Lc7/p3GtqtqPBYYtS6KCN3c77/2QCev51DvcJKbkFPQNoj1sinkGwLGFDxkXY9J6p9+EPnYs+D90uwbnaiURTw==",
|
||||
"dependencies": {
|
||||
"readable-stream": "^2.3.7",
|
||||
"triple-beam": "^1.2.0"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/winston-transport/node_modules/readable-stream": {
|
||||
"version": "2.3.7",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
|
||||
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
|
||||
"dependencies": {
|
||||
"core-util-is": "~1.0.0",
|
||||
"inherits": "~2.0.3",
|
||||
"isarray": "~1.0.0",
|
||||
"process-nextick-args": "~2.0.0",
|
||||
"safe-buffer": "~5.1.1",
|
||||
"string_decoder": "~1.1.1",
|
||||
"util-deprecate": "~1.0.1"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/winston-transport/node_modules/safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/winston-transport/node_modules/string_decoder": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
|
||||
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
|
||||
"dependencies": {
|
||||
"safe-buffer": "~5.1.0"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/wrtc": {
|
||||
"version": "0.4.6",
|
||||
"resolved": "https://registry.npmjs.org/wrtc/-/wrtc-0.4.6.tgz",
|
||||
"integrity": "sha512-4uD+oFoY2yuo3AV9fum3cXUXR6v8YQHZlqBrKkCRGjW1BvKrVHtLNH4UaNLBLiJu9DL89WqUWmbzsQ9RxMzANw==",
|
||||
"dependencies": {
|
||||
"node-pre-gyp": "^0.13.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"domexception": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/yaeti": {
|
||||
"version": "0.0.6",
|
||||
"resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz",
|
||||
"integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc="
|
||||
},
|
||||
"../net_drivers/webrtc/node_modules/yallist": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
|
||||
"integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="
|
||||
},
|
||||
"node_modules/nbnet": {
|
||||
"resolved": "../net_drivers/webrtc",
|
||||
"link": true
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"nbnet": {
|
||||
"version": "file:../net_drivers/webrtc",
|
||||
@@ -673,6 +1536,14 @@
|
||||
"resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz",
|
||||
"integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA="
|
||||
},
|
||||
"string_decoder": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
|
||||
"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
|
||||
"requires": {
|
||||
"safe-buffer": "~5.2.0"
|
||||
}
|
||||
},
|
||||
"string-width": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
|
||||
@@ -683,14 +1554,6 @@
|
||||
"strip-ansi": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"string_decoder": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
|
||||
"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
|
||||
"requires": {
|
||||
"safe-buffer": "~5.2.0"
|
||||
}
|
||||
},
|
||||
"strip-ansi": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"scripts": {
|
||||
"server": "node --experimental-wasm-threads build/server.js",
|
||||
"client": "node --experimental-wasm-threads build/client.js"
|
||||
"server": "node --experimental-wasm-threads build_web/server.js",
|
||||
"client": "node --experimental-wasm-threads build_web/client.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"nbnet": "file:../net_drivers/webrtc"
|
||||
|
||||
+24
-7
@@ -34,7 +34,7 @@
|
||||
#else
|
||||
#include "../net_drivers/udp.h"
|
||||
|
||||
#ifdef SOAK_WEBRTC_C_DRIVER
|
||||
#ifdef WEBRTC_NATIVE
|
||||
#include "../net_drivers/webrtc_c.h"
|
||||
#endif
|
||||
|
||||
@@ -337,17 +337,30 @@ int main(int argc, char *argv[])
|
||||
|
||||
Soak_SetLogLevel(LOG_TRACE);
|
||||
|
||||
if (Soak_ReadCommandLine(argc, argv) < 0)
|
||||
return -1;
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
NBN_WebRTC_Register(); // Register the WebRTC driver
|
||||
NBN_WebRTC_Register((NBN_WebRTC_Config){.enable_tls = false}); // Register JS WebRTC driver
|
||||
#else
|
||||
NBN_UDP_Register(); // Register the UDP driver
|
||||
|
||||
#ifdef SOAK_WEBRTC_C_DRIVER
|
||||
NBN_WebRTC_C_Register(); // Register native WebRTC driver
|
||||
#endif
|
||||
|
||||
#endif // __EMSCRIPTEN__
|
||||
|
||||
#ifdef WEBRTC_NATIVE
|
||||
// Register native WebRTC driver
|
||||
const char *ice_servers[] = { "stun:stun01.sipphone.com" };
|
||||
NBN_WebRTC_C_Config cfg = {
|
||||
.ice_servers = ice_servers,
|
||||
.ice_servers_count = 1,
|
||||
.enable_tls = false,
|
||||
.cert_path = NULL,
|
||||
.key_path = NULL,
|
||||
.passphrase = NULL,
|
||||
.log_level = RTC_LOG_VERBOSE};
|
||||
|
||||
NBN_WebRTC_C_Register(cfg);
|
||||
#endif // WEBRTC_NATIVE
|
||||
|
||||
if (NBN_GameServer_Start(SOAK_PROTOCOL_NAME, SOAK_PORT))
|
||||
{
|
||||
Soak_LogError("Failed to start game server");
|
||||
@@ -369,5 +382,9 @@ int main(int argc, char *argv[])
|
||||
NBN_GameServer_Stop();
|
||||
Soak_Deinit();
|
||||
|
||||
#ifdef WEBRTC_NATIVE
|
||||
NBN_WebRTC_C_Unregister();
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
+23
-6
@@ -45,8 +45,15 @@ static unsigned int destroyed_incoming_soak_message_count = 0;
|
||||
static void Usage(void)
|
||||
{
|
||||
#ifdef SOAK_CLIENT
|
||||
printf("Usage: client --message_count=<value> --channel_count=<value> [--packet_loss=<value>] \
|
||||
|
||||
#ifdef WEBRTC_NATIVE
|
||||
printf("Usage: client --message_count=<value> --channel_count=<value> [--packet_loss=<value>] \
|
||||
[--packet_duplication=<value>] [--ping=<value>] [--jitter=<value>] [--webrtc]\n");
|
||||
#else
|
||||
printf("Usage: client --message_count=<value> --channel_count=<value> [--packet_loss=<value>] \
|
||||
[--packet_duplication=<value>] [--ping=<value>] [--jitter=<value>]\n");
|
||||
#endif // WEBRTC_NATIVE
|
||||
|
||||
#endif // SOAK_CLIENT
|
||||
|
||||
#ifdef SOAK_SERVER
|
||||
@@ -59,13 +66,10 @@ int Soak_Init(int argc, char *argv[])
|
||||
{
|
||||
srand(SOAK_SEED);
|
||||
|
||||
if (Soak_ReadCommandLine(argc, argv) < 0)
|
||||
return -1;
|
||||
|
||||
SoakOptions options = Soak_GetOptions();
|
||||
|
||||
Soak_LogInfo("Soak test initialized (Packet loss: %f, Packet duplication: %f, Ping: %f, Jitter: %f)",
|
||||
options.packet_loss, options.packet_duplication, options.ping, options.jitter);
|
||||
options.packet_loss, options.packet_duplication, options.ping, options.jitter);
|
||||
|
||||
#ifdef SOAK_CLIENT
|
||||
|
||||
@@ -114,8 +118,17 @@ int Soak_ReadCommandLine(int argc, char *argv[])
|
||||
{
|
||||
struct cag_option options[] = {
|
||||
#ifdef SOAK_CLIENT
|
||||
|
||||
{'m', NULL, "message_count", "VALUE", "Number of messages to send"},
|
||||
#endif
|
||||
|
||||
#ifdef WEBRTC_NATIVE
|
||||
|
||||
{'w', NULL, "webrtc", NULL, "Use the native WebRTC driver instead of the UDP driver"},
|
||||
|
||||
#endif // WEBRTC_NATIVE
|
||||
|
||||
#endif // SOAK_CLIENT
|
||||
|
||||
{'c', NULL, "channel_count", "VALUE", "Number of channels (1-NBN_MAX_CHANNELS)"},
|
||||
{'l', NULL, "packet_loss", "VALUE", "Packet loss frenquency (0-1)"},
|
||||
{'d', NULL, "packet_duplication", "VALUE", "Packet duplication frequency (0-1)"},
|
||||
@@ -141,6 +154,10 @@ int Soak_ReadCommandLine(int argc, char *argv[])
|
||||
soak_options.message_count = atoi(val);
|
||||
}
|
||||
}
|
||||
else if (option == 'w')
|
||||
{
|
||||
soak_options.webrtc = true;
|
||||
}
|
||||
#else
|
||||
if (false) {}
|
||||
#endif
|
||||
|
||||
@@ -69,6 +69,7 @@ typedef struct
|
||||
float packet_duplication; /* 0 - 1 */
|
||||
float ping; /* in seconds */
|
||||
float jitter; /* in seconds */
|
||||
bool webrtc; /* use native WebRTC driver */
|
||||
} SoakOptions;
|
||||
|
||||
typedef struct
|
||||
|
||||
@@ -14,7 +14,6 @@ target_link_libraries(serialization_tests -lm)
|
||||
# FIXME: adapt to latest API
|
||||
# add_test(message_chunks message_chunks)
|
||||
add_test(serialization_tests serialization_tests)
|
||||
# FIXME: segfault
|
||||
# add_test(string_tests string_tests)
|
||||
add_test(string_tests string_tests)
|
||||
|
||||
target_compile_definitions(serialization_tests PUBLIC NBN_DEBUG)
|
||||
+13
-24
@@ -4,36 +4,25 @@
|
||||
|
||||
#include "CuTest.h"
|
||||
|
||||
static int StringReplaceAll(char *res, unsigned int len, const char *str, const char *a, const char *b)
|
||||
static void StringReplaceAll(char *res, const char *str, const char *a, const char *b)
|
||||
{
|
||||
char *substr = strstr(str, a);
|
||||
char *res2 = malloc(len);
|
||||
size_t len_a = strlen(a);
|
||||
size_t len_b = strlen(b);
|
||||
|
||||
if (substr)
|
||||
{
|
||||
size_t len_a = strlen(a);
|
||||
size_t len_b = strlen(b);
|
||||
|
||||
if (strlen(str) + (len_b - len_a) >= len)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int pos = substr - str;
|
||||
|
||||
strncpy(res2, str, pos);
|
||||
strncpy(res2 + pos, b, len_b);
|
||||
strncpy(res2 + pos + len_b, str + pos + len_a, len - (pos + len_a) + 1);
|
||||
memcpy(res, res2, len);
|
||||
StringReplaceAll(res, len, res2, a, b);
|
||||
free(res2);
|
||||
strncpy(res, str, pos);
|
||||
strncpy(res + pos, b, len_b);
|
||||
|
||||
StringReplaceAll(res + pos + len_b, str + pos + len_a, a, b);
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(res, str, len);
|
||||
strncpy(res, str, strlen(str) + 1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Test_StringReplaceAll(CuTest *tc)
|
||||
@@ -45,12 +34,12 @@ void Test_StringReplaceAll(CuTest *tc)
|
||||
char res2[128] = {0};
|
||||
char res3[16] = {0};
|
||||
|
||||
CuAssertIntEquals(tc, 0, StringReplaceAll(res, sizeof(res), str, "foo", "hello"));
|
||||
StringReplaceAll(res, str, "foo", "hello");
|
||||
CuAssertStrEquals(tc, "hello bar plop hello plap test hello", res);
|
||||
CuAssertIntEquals(tc, 0, StringReplaceAll(res2, sizeof(res2), str2, "\n", "\\n"));
|
||||
StringReplaceAll(res2, str2, "\n", "\\n");
|
||||
CuAssertStrEquals(tc, "foo bar\\nplop\\n\\nplap", res2);
|
||||
CuAssertIntEquals(tc, 0, StringReplaceAll(res3, sizeof(res3), str3, "bar", "aaaaa"));
|
||||
CuAssertIntEquals(tc, -1, StringReplaceAll(res3, sizeof(res3), str3, "bar", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"));
|
||||
StringReplaceAll(res3, str3, "test", "aaaaa");
|
||||
CuAssertStrEquals(tc, "foo bar", res3);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
@@ -67,4 +56,4 @@ int main(int argc, char *argv[])
|
||||
printf("%s\n", output->buffer);
|
||||
|
||||
return suite->failCount;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user