node-datachannel 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/build-linux.yml +109 -0
- package/.github/workflows/build-mac.yml +40 -0
- package/.github/workflows/build-win.yml +77 -0
- package/.github/workflows/npm-publish-manual.yml +23 -0
- package/CMakeLists.txt +73 -0
- package/LICENSE +504 -0
- package/README.md +180 -0
- package/cmake/toolchain/arm64.cmake +17 -0
- package/cmake/toolchain/armv7.cmake +17 -0
- package/examples/README.md +21 -0
- package/examples/client-server/client-benchmark.js +216 -0
- package/examples/client-server/client-periodic.js +176 -0
- package/examples/client-server/client.js +113 -0
- package/examples/client-server/package-lock.json +126 -0
- package/examples/client-server/package.json +16 -0
- package/examples/client-server/signaling-server.js +31 -0
- package/lib/index.d.ts +123 -0
- package/lib/index.js +2 -0
- package/node_modules/ansi-regex/index.js +4 -0
- package/node_modules/ansi-regex/license +21 -0
- package/node_modules/ansi-regex/package.json +111 -0
- package/node_modules/ansi-regex/readme.md +39 -0
- package/node_modules/aproba/LICENSE +14 -0
- package/node_modules/aproba/README.md +94 -0
- package/node_modules/aproba/index.js +105 -0
- package/node_modules/aproba/package.json +65 -0
- package/node_modules/base64-js/LICENSE +21 -0
- package/node_modules/base64-js/README.md +34 -0
- package/node_modules/base64-js/base64js.min.js +1 -0
- package/node_modules/base64-js/index.d.ts +3 -0
- package/node_modules/base64-js/index.js +150 -0
- package/node_modules/base64-js/package.json +78 -0
- package/node_modules/buffer/AUTHORS.md +70 -0
- package/node_modules/buffer/LICENSE +21 -0
- package/node_modules/buffer/README.md +410 -0
- package/node_modules/buffer/index.d.ts +186 -0
- package/node_modules/buffer/index.js +1817 -0
- package/node_modules/buffer/package.json +130 -0
- package/node_modules/chownr/LICENSE +15 -0
- package/node_modules/chownr/README.md +3 -0
- package/node_modules/chownr/chownr.js +167 -0
- package/node_modules/chownr/package.json +66 -0
- package/node_modules/code-point-at/index.js +32 -0
- package/node_modules/code-point-at/license +21 -0
- package/node_modules/code-point-at/package.json +73 -0
- package/node_modules/code-point-at/readme.md +32 -0
- package/node_modules/console-control-strings/LICENSE +13 -0
- package/node_modules/console-control-strings/README.md +145 -0
- package/node_modules/console-control-strings/README.md~ +140 -0
- package/node_modules/console-control-strings/index.js +125 -0
- package/node_modules/console-control-strings/package.json +64 -0
- package/node_modules/core-util-is/LICENSE +19 -0
- package/node_modules/core-util-is/README.md +3 -0
- package/node_modules/core-util-is/float.patch +604 -0
- package/node_modules/core-util-is/lib/util.js +107 -0
- package/node_modules/core-util-is/package.json +70 -0
- package/node_modules/core-util-is/test.js +68 -0
- package/node_modules/decompress-response/index.d.ts +29 -0
- package/node_modules/decompress-response/index.js +40 -0
- package/node_modules/decompress-response/license +9 -0
- package/node_modules/decompress-response/package.json +85 -0
- package/node_modules/decompress-response/readme.md +52 -0
- package/node_modules/deep-extend/CHANGELOG.md +46 -0
- package/node_modules/deep-extend/LICENSE +20 -0
- package/node_modules/deep-extend/README.md +91 -0
- package/node_modules/deep-extend/index.js +1 -0
- package/node_modules/deep-extend/lib/deep-extend.js +150 -0
- package/node_modules/deep-extend/package.json +95 -0
- package/node_modules/delegates/.npmignore +1 -0
- package/node_modules/delegates/History.md +22 -0
- package/node_modules/delegates/License +20 -0
- package/node_modules/delegates/Makefile +8 -0
- package/node_modules/delegates/Readme.md +94 -0
- package/node_modules/delegates/index.js +121 -0
- package/node_modules/delegates/package.json +54 -0
- package/node_modules/delegates/test/index.js +94 -0
- package/node_modules/detect-libc/.npmignore +7 -0
- package/node_modules/detect-libc/LICENSE +201 -0
- package/node_modules/detect-libc/README.md +78 -0
- package/node_modules/detect-libc/bin/detect-libc.js +18 -0
- package/node_modules/detect-libc/lib/detect-libc.js +92 -0
- package/node_modules/detect-libc/package.json +74 -0
- package/node_modules/end-of-stream/LICENSE +21 -0
- package/node_modules/end-of-stream/README.md +54 -0
- package/node_modules/end-of-stream/index.js +94 -0
- package/node_modules/end-of-stream/package.json +69 -0
- package/node_modules/expand-template/.travis.yml +6 -0
- package/node_modules/expand-template/LICENSE +21 -0
- package/node_modules/expand-template/README.md +43 -0
- package/node_modules/expand-template/index.js +26 -0
- package/node_modules/expand-template/package.json +63 -0
- package/node_modules/expand-template/test.js +67 -0
- package/node_modules/fs-constants/LICENSE +21 -0
- package/node_modules/fs-constants/README.md +26 -0
- package/node_modules/fs-constants/browser.js +1 -0
- package/node_modules/fs-constants/index.js +1 -0
- package/node_modules/fs-constants/package.json +50 -0
- package/node_modules/github-from-package/.travis.yml +4 -0
- package/node_modules/github-from-package/LICENSE +18 -0
- package/node_modules/github-from-package/example/package.json +8 -0
- package/node_modules/github-from-package/example/url.js +3 -0
- package/node_modules/github-from-package/index.js +17 -0
- package/node_modules/github-from-package/package.json +62 -0
- package/node_modules/github-from-package/readme.markdown +53 -0
- package/node_modules/github-from-package/test/a.json +8 -0
- package/node_modules/github-from-package/test/b.json +5 -0
- package/node_modules/github-from-package/test/c.json +5 -0
- package/node_modules/github-from-package/test/d.json +7 -0
- package/node_modules/github-from-package/test/e.json +5 -0
- package/node_modules/github-from-package/test/url.js +19 -0
- package/node_modules/has-unicode/LICENSE +14 -0
- package/node_modules/has-unicode/README.md +43 -0
- package/node_modules/has-unicode/index.js +16 -0
- package/node_modules/has-unicode/package.json +63 -0
- package/node_modules/ieee754/LICENSE +11 -0
- package/node_modules/ieee754/README.md +51 -0
- package/node_modules/ieee754/index.d.ts +10 -0
- package/node_modules/ieee754/index.js +85 -0
- package/node_modules/ieee754/package.json +87 -0
- package/node_modules/inherits/LICENSE +16 -0
- package/node_modules/inherits/README.md +42 -0
- package/node_modules/inherits/inherits.js +9 -0
- package/node_modules/inherits/inherits_browser.js +27 -0
- package/node_modules/inherits/package.json +78 -0
- package/node_modules/ini/LICENSE +15 -0
- package/node_modules/ini/README.md +102 -0
- package/node_modules/ini/ini.js +194 -0
- package/node_modules/ini/package.json +66 -0
- package/node_modules/is-fullwidth-code-point/index.js +46 -0
- package/node_modules/is-fullwidth-code-point/license +21 -0
- package/node_modules/is-fullwidth-code-point/package.json +80 -0
- package/node_modules/is-fullwidth-code-point/readme.md +39 -0
- package/node_modules/isarray/.npmignore +1 -0
- package/node_modules/isarray/.travis.yml +4 -0
- package/node_modules/isarray/Makefile +6 -0
- package/node_modules/isarray/README.md +60 -0
- package/node_modules/isarray/component.json +19 -0
- package/node_modules/isarray/index.js +5 -0
- package/node_modules/isarray/package.json +77 -0
- package/node_modules/isarray/test.js +20 -0
- package/node_modules/mimic-response/index.d.ts +17 -0
- package/node_modules/mimic-response/index.js +38 -0
- package/node_modules/mimic-response/license +9 -0
- package/node_modules/mimic-response/package.json +77 -0
- package/node_modules/mimic-response/readme.md +57 -0
- package/node_modules/minimist/.travis.yml +8 -0
- package/node_modules/minimist/LICENSE +18 -0
- package/node_modules/minimist/example/parse.js +2 -0
- package/node_modules/minimist/index.js +245 -0
- package/node_modules/minimist/package.json +80 -0
- package/node_modules/minimist/readme.markdown +95 -0
- package/node_modules/minimist/test/all_bool.js +32 -0
- package/node_modules/minimist/test/bool.js +178 -0
- package/node_modules/minimist/test/dash.js +31 -0
- package/node_modules/minimist/test/default_bool.js +35 -0
- package/node_modules/minimist/test/dotted.js +22 -0
- package/node_modules/minimist/test/kv_short.js +16 -0
- package/node_modules/minimist/test/long.js +31 -0
- package/node_modules/minimist/test/num.js +36 -0
- package/node_modules/minimist/test/parse.js +197 -0
- package/node_modules/minimist/test/parse_modified.js +9 -0
- package/node_modules/minimist/test/proto.js +44 -0
- package/node_modules/minimist/test/short.js +67 -0
- package/node_modules/minimist/test/stop_early.js +15 -0
- package/node_modules/minimist/test/unknown.js +102 -0
- package/node_modules/minimist/test/whitespace.js +8 -0
- package/node_modules/mkdirp-classic/LICENSE +21 -0
- package/node_modules/mkdirp-classic/README.md +18 -0
- package/node_modules/mkdirp-classic/index.js +98 -0
- package/node_modules/mkdirp-classic/package.json +50 -0
- package/node_modules/napi-build-utils/LICENSE +21 -0
- package/node_modules/napi-build-utils/README.md +48 -0
- package/node_modules/napi-build-utils/index.js +213 -0
- package/node_modules/napi-build-utils/index.md +81 -0
- package/node_modules/napi-build-utils/package.json +72 -0
- package/node_modules/node-abi/.github/workflows/update-abi.yml +41 -0
- package/node_modules/node-abi/.travis.yml +19 -0
- package/node_modules/node-abi/CODE_OF_CONDUCT.md +73 -0
- package/node_modules/node-abi/CONTRIBUTING.md +53 -0
- package/node_modules/node-abi/LICENSE +21 -0
- package/node_modules/node-abi/README.md +50 -0
- package/node_modules/node-abi/abi_registry.json +99 -0
- package/node_modules/node-abi/index.js +170 -0
- package/node_modules/node-abi/package.json +69 -0
- package/node_modules/node-abi/scripts/update-abi-registry.js +113 -0
- package/node_modules/node-abi/test/index.js +174 -0
- package/node_modules/noop-logger/.npmignore +1 -0
- package/node_modules/noop-logger/History.md +16 -0
- package/node_modules/noop-logger/Makefile +8 -0
- package/node_modules/noop-logger/Readme.md +27 -0
- package/node_modules/noop-logger/circle.yml +9 -0
- package/node_modules/noop-logger/lib/index.js +25 -0
- package/node_modules/noop-logger/package.json +51 -0
- package/node_modules/noop-logger/test/index.js +18 -0
- package/node_modules/npmlog/CHANGELOG.md +49 -0
- package/node_modules/npmlog/LICENSE +15 -0
- package/node_modules/npmlog/README.md +216 -0
- package/node_modules/npmlog/log.js +309 -0
- package/node_modules/npmlog/node_modules/are-we-there-yet/CHANGES.md +37 -0
- package/node_modules/npmlog/node_modules/are-we-there-yet/LICENSE +5 -0
- package/node_modules/npmlog/node_modules/are-we-there-yet/README.md +195 -0
- package/node_modules/npmlog/node_modules/are-we-there-yet/index.js +4 -0
- package/node_modules/npmlog/node_modules/are-we-there-yet/package.json +66 -0
- package/node_modules/npmlog/node_modules/are-we-there-yet/tracker-base.js +11 -0
- package/node_modules/npmlog/node_modules/are-we-there-yet/tracker-group.js +107 -0
- package/node_modules/npmlog/node_modules/are-we-there-yet/tracker-stream.js +36 -0
- package/node_modules/npmlog/node_modules/are-we-there-yet/tracker.js +30 -0
- package/node_modules/npmlog/node_modules/gauge/CHANGELOG.md +160 -0
- package/node_modules/npmlog/node_modules/gauge/LICENSE +13 -0
- package/node_modules/npmlog/node_modules/gauge/README.md +399 -0
- package/node_modules/npmlog/node_modules/gauge/base-theme.js +14 -0
- package/node_modules/npmlog/node_modules/gauge/error.js +24 -0
- package/node_modules/npmlog/node_modules/gauge/has-color.js +12 -0
- package/node_modules/npmlog/node_modules/gauge/index.js +233 -0
- package/node_modules/npmlog/node_modules/gauge/package.json +94 -0
- package/node_modules/npmlog/node_modules/gauge/plumbing.js +48 -0
- package/node_modules/npmlog/node_modules/gauge/process.js +3 -0
- package/node_modules/npmlog/node_modules/gauge/progress-bar.js +35 -0
- package/node_modules/npmlog/node_modules/gauge/render-template.js +181 -0
- package/node_modules/npmlog/node_modules/gauge/set-immediate.js +7 -0
- package/node_modules/npmlog/node_modules/gauge/set-interval.js +3 -0
- package/node_modules/npmlog/node_modules/gauge/spin.js +5 -0
- package/node_modules/npmlog/node_modules/gauge/template-item.js +73 -0
- package/node_modules/npmlog/node_modules/gauge/theme-set.js +115 -0
- package/node_modules/npmlog/node_modules/gauge/themes.js +54 -0
- package/node_modules/npmlog/node_modules/gauge/wide-truncate.js +25 -0
- package/node_modules/npmlog/package.json +78 -0
- package/node_modules/number-is-nan/index.js +4 -0
- package/node_modules/number-is-nan/license +21 -0
- package/node_modules/number-is-nan/package.json +70 -0
- package/node_modules/number-is-nan/readme.md +28 -0
- package/node_modules/object-assign/index.js +90 -0
- package/node_modules/object-assign/license +21 -0
- package/node_modules/object-assign/package.json +77 -0
- package/node_modules/object-assign/readme.md +61 -0
- package/node_modules/once/LICENSE +15 -0
- package/node_modules/once/README.md +79 -0
- package/node_modules/once/once.js +42 -0
- package/node_modules/once/package.json +74 -0
- package/node_modules/prebuild-install/.travis.yml +12 -0
- package/node_modules/prebuild-install/CHANGELOG.md +7 -0
- package/node_modules/prebuild-install/CONTRIBUTING.md +6 -0
- package/node_modules/prebuild-install/LICENSE +21 -0
- package/node_modules/prebuild-install/README.md +108 -0
- package/node_modules/prebuild-install/appveyor.yml +40 -0
- package/node_modules/prebuild-install/asset.js +48 -0
- package/node_modules/prebuild-install/bin.js +85 -0
- package/node_modules/prebuild-install/download.js +130 -0
- package/node_modules/prebuild-install/error.js +14 -0
- package/node_modules/prebuild-install/help.txt +14 -0
- package/node_modules/prebuild-install/index.js +1 -0
- package/node_modules/prebuild-install/log.js +13 -0
- package/node_modules/prebuild-install/package.json +131 -0
- package/node_modules/prebuild-install/proxy.js +38 -0
- package/node_modules/prebuild-install/rc.js +81 -0
- package/node_modules/prebuild-install/util.js +97 -0
- package/node_modules/process-nextick-args/index.js +45 -0
- package/node_modules/process-nextick-args/license.md +19 -0
- package/node_modules/process-nextick-args/package.json +53 -0
- package/node_modules/process-nextick-args/readme.md +18 -0
- package/node_modules/pump/.travis.yml +5 -0
- package/node_modules/pump/LICENSE +21 -0
- package/node_modules/pump/README.md +65 -0
- package/node_modules/pump/index.js +82 -0
- package/node_modules/pump/package.json +63 -0
- package/node_modules/pump/test-browser.js +66 -0
- package/node_modules/pump/test-node.js +53 -0
- package/node_modules/rc/LICENSE.APACHE2 +15 -0
- package/node_modules/rc/LICENSE.BSD +26 -0
- package/node_modules/rc/LICENSE.MIT +24 -0
- package/node_modules/rc/README.md +227 -0
- package/node_modules/rc/browser.js +7 -0
- package/node_modules/rc/cli.js +4 -0
- package/node_modules/rc/index.js +53 -0
- package/node_modules/rc/lib/utils.js +104 -0
- package/node_modules/rc/package.json +70 -0
- package/node_modules/rc/test/ini.js +16 -0
- package/node_modules/rc/test/nested-env-vars.js +50 -0
- package/node_modules/rc/test/test.js +59 -0
- package/node_modules/readable-stream/.travis.yml +34 -0
- package/node_modules/readable-stream/CONTRIBUTING.md +38 -0
- package/node_modules/readable-stream/GOVERNANCE.md +136 -0
- package/node_modules/readable-stream/LICENSE +47 -0
- package/node_modules/readable-stream/README.md +58 -0
- package/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +60 -0
- package/node_modules/readable-stream/duplex-browser.js +1 -0
- package/node_modules/readable-stream/duplex.js +1 -0
- package/node_modules/readable-stream/lib/_stream_duplex.js +131 -0
- package/node_modules/readable-stream/lib/_stream_passthrough.js +47 -0
- package/node_modules/readable-stream/lib/_stream_readable.js +1019 -0
- package/node_modules/readable-stream/lib/_stream_transform.js +214 -0
- package/node_modules/readable-stream/lib/_stream_writable.js +687 -0
- package/node_modules/readable-stream/lib/internal/streams/BufferList.js +79 -0
- package/node_modules/readable-stream/lib/internal/streams/destroy.js +74 -0
- package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
- package/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
- package/node_modules/readable-stream/package.json +88 -0
- package/node_modules/readable-stream/passthrough.js +1 -0
- package/node_modules/readable-stream/readable-browser.js +7 -0
- package/node_modules/readable-stream/readable.js +19 -0
- package/node_modules/readable-stream/transform.js +1 -0
- package/node_modules/readable-stream/writable-browser.js +1 -0
- package/node_modules/readable-stream/writable.js +8 -0
- package/node_modules/safe-buffer/LICENSE +21 -0
- package/node_modules/safe-buffer/README.md +584 -0
- package/node_modules/safe-buffer/index.d.ts +187 -0
- package/node_modules/safe-buffer/index.js +62 -0
- package/node_modules/safe-buffer/package.json +71 -0
- package/node_modules/semver/CHANGELOG.md +39 -0
- package/node_modules/semver/LICENSE +15 -0
- package/node_modules/semver/README.md +412 -0
- package/node_modules/semver/bin/semver +160 -0
- package/node_modules/semver/package.json +67 -0
- package/node_modules/semver/range.bnf +16 -0
- package/node_modules/semver/semver.js +1483 -0
- package/node_modules/set-blocking/CHANGELOG.md +26 -0
- package/node_modules/set-blocking/LICENSE.txt +14 -0
- package/node_modules/set-blocking/README.md +31 -0
- package/node_modules/set-blocking/index.js +7 -0
- package/node_modules/set-blocking/package.json +73 -0
- package/node_modules/signal-exit/CHANGELOG.md +35 -0
- package/node_modules/signal-exit/LICENSE.txt +16 -0
- package/node_modules/signal-exit/README.md +39 -0
- package/node_modules/signal-exit/index.js +163 -0
- package/node_modules/signal-exit/package.json +71 -0
- package/node_modules/signal-exit/signals.js +53 -0
- package/node_modules/simple-concat/.travis.yml +3 -0
- package/node_modules/simple-concat/LICENSE +20 -0
- package/node_modules/simple-concat/README.md +44 -0
- package/node_modules/simple-concat/index.js +15 -0
- package/node_modules/simple-concat/package.json +75 -0
- package/node_modules/simple-concat/test/basic.js +41 -0
- package/node_modules/simple-get/LICENSE +20 -0
- package/node_modules/simple-get/README.md +319 -0
- package/node_modules/simple-get/index.js +99 -0
- package/node_modules/simple-get/package.json +81 -0
- package/node_modules/string-width/index.js +37 -0
- package/node_modules/string-width/license +21 -0
- package/node_modules/string-width/package.json +96 -0
- package/node_modules/string-width/readme.md +42 -0
- package/node_modules/string_decoder/.travis.yml +50 -0
- package/node_modules/string_decoder/LICENSE +48 -0
- package/node_modules/string_decoder/README.md +47 -0
- package/node_modules/string_decoder/lib/string_decoder.js +296 -0
- package/node_modules/string_decoder/package.json +64 -0
- package/node_modules/strip-ansi/index.js +6 -0
- package/node_modules/strip-ansi/license +21 -0
- package/node_modules/strip-ansi/package.json +107 -0
- package/node_modules/strip-ansi/readme.md +33 -0
- package/node_modules/strip-json-comments/index.js +70 -0
- package/node_modules/strip-json-comments/license +21 -0
- package/node_modules/strip-json-comments/package.json +77 -0
- package/node_modules/strip-json-comments/readme.md +64 -0
- package/node_modules/tar-fs/.travis.yml +6 -0
- package/node_modules/tar-fs/LICENSE +21 -0
- package/node_modules/tar-fs/README.md +165 -0
- package/node_modules/tar-fs/index.js +351 -0
- package/node_modules/tar-fs/package.json +71 -0
- package/node_modules/tar-fs/test/fixtures/a/hello.txt +1 -0
- package/node_modules/tar-fs/test/fixtures/b/a/test.txt +1 -0
- package/node_modules/tar-fs/test/fixtures/d/file1 +0 -0
- package/node_modules/tar-fs/test/fixtures/d/file2 +0 -0
- package/node_modules/tar-fs/test/fixtures/d/sub-dir/file5 +0 -0
- package/node_modules/tar-fs/test/fixtures/d/sub-files/file3 +0 -0
- package/node_modules/tar-fs/test/fixtures/d/sub-files/file4 +0 -0
- package/node_modules/tar-fs/test/fixtures/e/directory/.ignore +0 -0
- package/node_modules/tar-fs/test/fixtures/e/file +0 -0
- package/node_modules/tar-fs/test/fixtures/invalid.tar +0 -0
- package/node_modules/tar-fs/test/index.js +346 -0
- package/node_modules/tar-stream/LICENSE +21 -0
- package/node_modules/tar-stream/README.md +168 -0
- package/node_modules/tar-stream/extract.js +257 -0
- package/node_modules/tar-stream/headers.js +293 -0
- package/node_modules/tar-stream/index.js +2 -0
- package/node_modules/tar-stream/node_modules/bl/.travis.yml +16 -0
- package/node_modules/tar-stream/node_modules/bl/BufferList.js +396 -0
- package/node_modules/tar-stream/node_modules/bl/LICENSE.md +13 -0
- package/node_modules/tar-stream/node_modules/bl/README.md +247 -0
- package/node_modules/tar-stream/node_modules/bl/bl.js +84 -0
- package/node_modules/tar-stream/node_modules/bl/package.json +68 -0
- package/node_modules/tar-stream/node_modules/bl/test/convert.js +21 -0
- package/node_modules/tar-stream/node_modules/bl/test/indexOf.js +492 -0
- package/node_modules/tar-stream/node_modules/bl/test/isBufferList.js +32 -0
- package/node_modules/tar-stream/node_modules/bl/test/test.js +851 -0
- package/node_modules/tar-stream/node_modules/readable-stream/CONTRIBUTING.md +38 -0
- package/node_modules/tar-stream/node_modules/readable-stream/GOVERNANCE.md +136 -0
- package/node_modules/tar-stream/node_modules/readable-stream/LICENSE +47 -0
- package/node_modules/tar-stream/node_modules/readable-stream/README.md +106 -0
- package/node_modules/tar-stream/node_modules/readable-stream/errors-browser.js +127 -0
- package/node_modules/tar-stream/node_modules/readable-stream/errors.js +116 -0
- package/node_modules/tar-stream/node_modules/readable-stream/experimentalWarning.js +17 -0
- package/node_modules/tar-stream/node_modules/readable-stream/lib/_stream_duplex.js +139 -0
- package/node_modules/tar-stream/node_modules/readable-stream/lib/_stream_passthrough.js +39 -0
- package/node_modules/tar-stream/node_modules/readable-stream/lib/_stream_readable.js +1124 -0
- package/node_modules/tar-stream/node_modules/readable-stream/lib/_stream_transform.js +201 -0
- package/node_modules/tar-stream/node_modules/readable-stream/lib/_stream_writable.js +697 -0
- package/node_modules/tar-stream/node_modules/readable-stream/lib/internal/streams/async_iterator.js +207 -0
- package/node_modules/tar-stream/node_modules/readable-stream/lib/internal/streams/buffer_list.js +210 -0
- package/node_modules/tar-stream/node_modules/readable-stream/lib/internal/streams/destroy.js +105 -0
- package/node_modules/tar-stream/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +104 -0
- package/node_modules/tar-stream/node_modules/readable-stream/lib/internal/streams/from-browser.js +3 -0
- package/node_modules/tar-stream/node_modules/readable-stream/lib/internal/streams/from.js +64 -0
- package/node_modules/tar-stream/node_modules/readable-stream/lib/internal/streams/pipeline.js +97 -0
- package/node_modules/tar-stream/node_modules/readable-stream/lib/internal/streams/state.js +27 -0
- package/node_modules/tar-stream/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
- package/node_modules/tar-stream/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
- package/node_modules/tar-stream/node_modules/readable-stream/package.json +101 -0
- package/node_modules/tar-stream/node_modules/readable-stream/readable-browser.js +9 -0
- package/node_modules/tar-stream/node_modules/readable-stream/readable.js +16 -0
- package/node_modules/tar-stream/pack.js +255 -0
- package/node_modules/tar-stream/package.json +95 -0
- package/node_modules/tar-stream/sandbox.js +11 -0
- package/node_modules/tunnel-agent/LICENSE +55 -0
- package/node_modules/tunnel-agent/README.md +4 -0
- package/node_modules/tunnel-agent/index.js +244 -0
- package/node_modules/tunnel-agent/package.json +59 -0
- package/node_modules/util-deprecate/History.md +16 -0
- package/node_modules/util-deprecate/LICENSE +24 -0
- package/node_modules/util-deprecate/README.md +53 -0
- package/node_modules/util-deprecate/browser.js +67 -0
- package/node_modules/util-deprecate/node.js +6 -0
- package/node_modules/util-deprecate/package.json +62 -0
- package/node_modules/which-pm-runs/LICENSE +21 -0
- package/node_modules/which-pm-runs/README.md +29 -0
- package/node_modules/which-pm-runs/index.js +17 -0
- package/node_modules/which-pm-runs/package.json +64 -0
- package/node_modules/wide-align/LICENSE +14 -0
- package/node_modules/wide-align/README.md +47 -0
- package/node_modules/wide-align/align.js +65 -0
- package/node_modules/wide-align/package.json +69 -0
- package/node_modules/wrappy/LICENSE +15 -0
- package/node_modules/wrappy/README.md +36 -0
- package/node_modules/wrappy/package.json +62 -0
- package/node_modules/wrappy/wrappy.js +33 -0
- package/package.json +48 -0
- package/src/data-channel-wrapper.cpp +401 -0
- package/src/data-channel-wrapper.h +52 -0
- package/src/main.cpp +14 -0
- package/src/peer-connection-wrapper.cpp +720 -0
- package/src/peer-connection-wrapper.h +55 -0
- package/src/rtc-wrapper.cpp +110 -0
- package/src/rtc-wrapper.h +19 -0
- package/test/connectivity.js +100 -0
- package/test/test.js +149 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#ifndef DATA_CHANNEL_WRAPPER_H
|
|
2
|
+
#define DATA_CHANNEL_WRAPPER_H
|
|
3
|
+
|
|
4
|
+
#include <iostream>
|
|
5
|
+
#include <string>
|
|
6
|
+
#include <variant>
|
|
7
|
+
#include <memory>
|
|
8
|
+
#include <napi.h>
|
|
9
|
+
#include <napi-thread-safe-callback.hpp>
|
|
10
|
+
#include "rtc/rtc.hpp"
|
|
11
|
+
|
|
12
|
+
class DataChannelWrapper : public Napi::ObjectWrap<DataChannelWrapper>
|
|
13
|
+
{
|
|
14
|
+
public:
|
|
15
|
+
static Napi::FunctionReference constructor;
|
|
16
|
+
static Napi::Object Init(Napi::Env env, Napi::Object exports);
|
|
17
|
+
DataChannelWrapper(const Napi::CallbackInfo &info);
|
|
18
|
+
~DataChannelWrapper();
|
|
19
|
+
|
|
20
|
+
// Functions
|
|
21
|
+
void close(const Napi::CallbackInfo &info);
|
|
22
|
+
Napi::Value getLabel(const Napi::CallbackInfo &info);
|
|
23
|
+
Napi::Value sendMessage(const Napi::CallbackInfo &info);
|
|
24
|
+
Napi::Value sendMessageBinary(const Napi::CallbackInfo &info);
|
|
25
|
+
Napi::Value isOpen(const Napi::CallbackInfo &info);
|
|
26
|
+
Napi::Value availableAmount(const Napi::CallbackInfo &info);
|
|
27
|
+
Napi::Value bufferedAmount(const Napi::CallbackInfo &info);
|
|
28
|
+
Napi::Value maxMessageSize(const Napi::CallbackInfo &info);
|
|
29
|
+
void setBufferedAmountLowThreshold(const Napi::CallbackInfo &info);
|
|
30
|
+
|
|
31
|
+
// Callbacks
|
|
32
|
+
void onOpen(const Napi::CallbackInfo &info);
|
|
33
|
+
void onClosed(const Napi::CallbackInfo &info);
|
|
34
|
+
void onError(const Napi::CallbackInfo &info);
|
|
35
|
+
void onAvailable(const Napi::CallbackInfo &info);
|
|
36
|
+
void onBufferedAmountLow(const Napi::CallbackInfo &info);
|
|
37
|
+
void onMessage(const Napi::CallbackInfo &info);
|
|
38
|
+
|
|
39
|
+
private:
|
|
40
|
+
std::string mLabel;
|
|
41
|
+
std::shared_ptr<rtc::DataChannel> mDataChannelPtr = nullptr;
|
|
42
|
+
|
|
43
|
+
// Callback Ptrs
|
|
44
|
+
std::shared_ptr<ThreadSafeCallback> mOnOpenCallback = nullptr;
|
|
45
|
+
std::shared_ptr<ThreadSafeCallback> mOnClosedCallback = nullptr;
|
|
46
|
+
std::shared_ptr<ThreadSafeCallback> mOnErrorCallback = nullptr;
|
|
47
|
+
std::shared_ptr<ThreadSafeCallback> mOnAvailableCallback = nullptr;
|
|
48
|
+
std::shared_ptr<ThreadSafeCallback> mOnBufferedAmountLowCallback = nullptr;
|
|
49
|
+
std::shared_ptr<ThreadSafeCallback> mOnMessageCallback = nullptr;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
#endif // DATA_CHANNEL_WRAPPER_H
|
package/src/main.cpp
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#include <napi.h>
|
|
2
|
+
#include "rtc-wrapper.h"
|
|
3
|
+
#include "peer-connection-wrapper.h"
|
|
4
|
+
#include "data-channel-wrapper.h"
|
|
5
|
+
|
|
6
|
+
Napi::Object InitAll(Napi::Env env, Napi::Object exports)
|
|
7
|
+
{
|
|
8
|
+
RtcWrapper::Init(env, exports);
|
|
9
|
+
DataChannelWrapper::Init(env, exports);
|
|
10
|
+
PeerConnectionWrapper::Init(env, exports);
|
|
11
|
+
return exports;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
NODE_API_MODULE(nodeDataChannel, InitAll)
|
|
@@ -0,0 +1,720 @@
|
|
|
1
|
+
#include "peer-connection-wrapper.h"
|
|
2
|
+
#include "data-channel-wrapper.h"
|
|
3
|
+
#include <sstream>
|
|
4
|
+
|
|
5
|
+
Napi::FunctionReference PeerConnectionWrapper::constructor;
|
|
6
|
+
|
|
7
|
+
Napi::Object PeerConnectionWrapper::Init(Napi::Env env, Napi::Object exports)
|
|
8
|
+
{
|
|
9
|
+
Napi::HandleScope scope(env);
|
|
10
|
+
|
|
11
|
+
Napi::Function func = DefineClass(
|
|
12
|
+
env,
|
|
13
|
+
"PeerConnection",
|
|
14
|
+
{InstanceMethod("close", &PeerConnectionWrapper::close),
|
|
15
|
+
InstanceMethod("setRemoteDescription", &PeerConnectionWrapper::setRemoteDescription),
|
|
16
|
+
InstanceMethod("addRemoteCandidate", &PeerConnectionWrapper::addRemoteCandidate),
|
|
17
|
+
InstanceMethod("createDataChannel", &PeerConnectionWrapper::createDataChannel),
|
|
18
|
+
InstanceMethod("onLocalDescription", &PeerConnectionWrapper::onLocalDescription),
|
|
19
|
+
InstanceMethod("onLocalCandidate", &PeerConnectionWrapper::onLocalCandidate),
|
|
20
|
+
InstanceMethod("onStateChange", &PeerConnectionWrapper::onStateChange),
|
|
21
|
+
InstanceMethod("onGatheringStateChange", &PeerConnectionWrapper::onGatheringStateChange),
|
|
22
|
+
InstanceMethod("onDataChannel", &PeerConnectionWrapper::onDataChannel),
|
|
23
|
+
InstanceMethod("bytesSent", &PeerConnectionWrapper::bytesSent),
|
|
24
|
+
InstanceMethod("bytesReceived", &PeerConnectionWrapper::bytesReceived),
|
|
25
|
+
InstanceMethod("rtt", &PeerConnectionWrapper::rtt),
|
|
26
|
+
InstanceMethod("getSelectedCandidatePair", &PeerConnectionWrapper::getSelectedCandidatePair)});
|
|
27
|
+
|
|
28
|
+
constructor = Napi::Persistent(func);
|
|
29
|
+
constructor.SuppressDestruct();
|
|
30
|
+
|
|
31
|
+
exports.Set("PeerConnection", func);
|
|
32
|
+
return exports;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
PeerConnectionWrapper::PeerConnectionWrapper(const Napi::CallbackInfo &info) : Napi::ObjectWrap<PeerConnectionWrapper>(info)
|
|
36
|
+
{
|
|
37
|
+
Napi::Env env = info.Env();
|
|
38
|
+
int length = info.Length();
|
|
39
|
+
|
|
40
|
+
// We expect (String, Object, Function) as param
|
|
41
|
+
if (length < 2 || !info[0].IsString() || !info[1].IsObject())
|
|
42
|
+
{
|
|
43
|
+
Napi::TypeError::New(env, "Peer Name (String) & Configuration (Object) expected").ThrowAsJavaScriptException();
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Peer Name
|
|
48
|
+
mPeerName = info[0].As<Napi::String>().ToString();
|
|
49
|
+
|
|
50
|
+
// Peer Config
|
|
51
|
+
rtc::Configuration rtcConfig;
|
|
52
|
+
Napi::Object config = info[1].As<Napi::Object>();
|
|
53
|
+
if (!config.Get("iceServers").IsArray())
|
|
54
|
+
{
|
|
55
|
+
Napi::TypeError::New(env, "iceServers(Array) expected").ThrowAsJavaScriptException();
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
Napi::Array iceServers = config.Get("iceServers").As<Napi::Array>();
|
|
60
|
+
for (uint32_t i = 0; i < iceServers.Length(); i++)
|
|
61
|
+
{
|
|
62
|
+
if (iceServers.Get(i).IsString())
|
|
63
|
+
rtcConfig.iceServers.emplace_back(iceServers.Get(i).As<Napi::String>().ToString());
|
|
64
|
+
else
|
|
65
|
+
{
|
|
66
|
+
if (!iceServers.Get(i).IsObject())
|
|
67
|
+
{
|
|
68
|
+
Napi::TypeError::New(env, "IceServer config should be a string Or an object").ThrowAsJavaScriptException();
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
Napi::Object iceServer = iceServers.Get(i).As<Napi::Object>();
|
|
73
|
+
if (!iceServer.Get("hostname").IsString() || !iceServer.Get("port").IsNumber())
|
|
74
|
+
{
|
|
75
|
+
Napi::TypeError::New(env, "IceServer config error (hostname OR/AND port is not suitable)").ThrowAsJavaScriptException();
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (iceServer.Get("relayType").IsString() &&
|
|
80
|
+
(!iceServer.Get("username").IsString() || !iceServer.Get("password").IsString()))
|
|
81
|
+
{
|
|
82
|
+
Napi::TypeError::New(env, "IceServer config error (username AND password is needed)").ThrowAsJavaScriptException();
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (iceServer.Get("relayType").IsString())
|
|
87
|
+
{
|
|
88
|
+
std::string relayTypeStr = iceServer.Get("relayType").As<Napi::String>();
|
|
89
|
+
rtc::IceServer::RelayType relayType = rtc::IceServer::RelayType::TurnUdp;
|
|
90
|
+
if (relayTypeStr.compare("TurnTcp") == 0)
|
|
91
|
+
relayType = rtc::IceServer::RelayType::TurnTcp;
|
|
92
|
+
if (relayTypeStr.compare("TurnTls") == 0)
|
|
93
|
+
relayType = rtc::IceServer::RelayType::TurnTls;
|
|
94
|
+
|
|
95
|
+
rtcConfig.iceServers.emplace_back(
|
|
96
|
+
rtc::IceServer(iceServer.Get("hostname").As<Napi::String>(),
|
|
97
|
+
uint16_t(iceServer.Get("port").As<Napi::Number>().Uint32Value()),
|
|
98
|
+
iceServer.Get("username").As<Napi::String>(),
|
|
99
|
+
iceServer.Get("password").As<Napi::String>(),
|
|
100
|
+
relayType));
|
|
101
|
+
}
|
|
102
|
+
else
|
|
103
|
+
{
|
|
104
|
+
rtcConfig.iceServers.emplace_back(
|
|
105
|
+
rtc::IceServer(
|
|
106
|
+
iceServer.Get("hostname").As<Napi::String>(),
|
|
107
|
+
uint16_t(iceServer.Get("port").As<Napi::Number>().Uint32Value())));
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Proxy Server
|
|
113
|
+
if (config.Get("proxyServer").IsObject())
|
|
114
|
+
{
|
|
115
|
+
Napi::Object proxyServer = config.Get("proxyServer").As<Napi::Object>();
|
|
116
|
+
|
|
117
|
+
// IP
|
|
118
|
+
std::string ip = proxyServer.Get("ip").As<Napi::String>();
|
|
119
|
+
|
|
120
|
+
// Port
|
|
121
|
+
uint16_t port = proxyServer.Get("port").As<Napi::Number>().Uint32Value();
|
|
122
|
+
|
|
123
|
+
// Type
|
|
124
|
+
std::string strType = proxyServer.Get("type").As<Napi::String>().ToString();
|
|
125
|
+
rtc::ProxyServer::Type type = rtc::ProxyServer::Type::Http;
|
|
126
|
+
|
|
127
|
+
if (strType == "None")
|
|
128
|
+
type = rtc::ProxyServer::Type::None;
|
|
129
|
+
if (strType == "Http")
|
|
130
|
+
type = rtc::ProxyServer::Type::Http;
|
|
131
|
+
if (strType == "Socks5")
|
|
132
|
+
type = rtc::ProxyServer::Type::Socks5;
|
|
133
|
+
|
|
134
|
+
// Username & Password
|
|
135
|
+
std::string username = "";
|
|
136
|
+
std::string password = "";
|
|
137
|
+
|
|
138
|
+
if (proxyServer.Get("username").IsString())
|
|
139
|
+
username = proxyServer.Get("username").As<Napi::String>().ToString();
|
|
140
|
+
if (proxyServer.Get("password").IsString())
|
|
141
|
+
username = proxyServer.Get("password").As<Napi::String>().ToString();
|
|
142
|
+
|
|
143
|
+
rtcConfig.proxyServer = rtc::ProxyServer(type, ip, port, username, password);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// Port Ranges
|
|
147
|
+
if (config.Get("portRangeBegin").IsNumber())
|
|
148
|
+
rtcConfig.portRangeBegin = config.Get("portRangeBegin").As<Napi::Number>().Uint32Value();
|
|
149
|
+
if (config.Get("portRangeEnd").IsNumber())
|
|
150
|
+
rtcConfig.portRangeEnd = config.Get("portRangeEnd").As<Napi::Number>().Uint32Value();
|
|
151
|
+
|
|
152
|
+
// enableIceTcp option
|
|
153
|
+
if (config.Get("enableIceTcp").IsBoolean())
|
|
154
|
+
rtcConfig.enableIceTcp = config.Get("enableIceTcp").As<Napi::Boolean>();
|
|
155
|
+
|
|
156
|
+
// Max Message Size
|
|
157
|
+
if (config.Get("maxMessageSize").IsNumber())
|
|
158
|
+
rtcConfig.maxMessageSize = config.Get("maxMessageSize").As<Napi::Number>().Uint32Value();
|
|
159
|
+
|
|
160
|
+
// ICE transport policy
|
|
161
|
+
if (!config.Get("iceTransportPolicy").IsUndefined())
|
|
162
|
+
{
|
|
163
|
+
if (!config.Get("iceTransportPolicy").IsString())
|
|
164
|
+
{
|
|
165
|
+
Napi::TypeError::New(env, "Invalid ICE transport policy, expected string").ThrowAsJavaScriptException();
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
std::string strPolicy = config.Get("iceTransportPolicy").As<Napi::String>().ToString();
|
|
169
|
+
if(strPolicy == "all")
|
|
170
|
+
rtcConfig.iceTransportPolicy = rtc::TransportPolicy::All;
|
|
171
|
+
else if(strPolicy == "relay")
|
|
172
|
+
rtcConfig.iceTransportPolicy = rtc::TransportPolicy::Relay;
|
|
173
|
+
else
|
|
174
|
+
{
|
|
175
|
+
Napi::TypeError::New(env, "Unknown ICE transport policy").ThrowAsJavaScriptException();
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// Create peer-connection
|
|
181
|
+
try
|
|
182
|
+
{
|
|
183
|
+
mRtcPeerConnPtr = std::make_shared<rtc::PeerConnection>(rtcConfig);
|
|
184
|
+
}
|
|
185
|
+
catch (std::exception &ex)
|
|
186
|
+
{
|
|
187
|
+
Napi::Error::New(env, std::string("libdatachannel error while creating peerConnection# ") + ex.what()).ThrowAsJavaScriptException();
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
PeerConnectionWrapper::~PeerConnectionWrapper()
|
|
193
|
+
{
|
|
194
|
+
if (mRtcPeerConnPtr)
|
|
195
|
+
{
|
|
196
|
+
try
|
|
197
|
+
{
|
|
198
|
+
mRtcPeerConnPtr->close();
|
|
199
|
+
mRtcPeerConnPtr.reset();
|
|
200
|
+
}
|
|
201
|
+
catch (std::exception &ex)
|
|
202
|
+
{
|
|
203
|
+
std::cout << std::string("libdatachannel error while closing peerConnection# ") + ex.what() << std::endl;
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
void PeerConnectionWrapper::close(const Napi::CallbackInfo &info)
|
|
210
|
+
{
|
|
211
|
+
Napi::Env env = info.Env();
|
|
212
|
+
if (!mRtcPeerConnPtr)
|
|
213
|
+
{
|
|
214
|
+
Napi::Error::New(info.Env(), "It seems peer-connection is closed").ThrowAsJavaScriptException();
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
try
|
|
219
|
+
{
|
|
220
|
+
mRtcPeerConnPtr->close();
|
|
221
|
+
mRtcPeerConnPtr.reset();
|
|
222
|
+
}
|
|
223
|
+
catch (std::exception &ex)
|
|
224
|
+
{
|
|
225
|
+
Napi::Error::New(env, std::string("libdatachannel error while closing peerConnection# ") + ex.what()).ThrowAsJavaScriptException();
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
void PeerConnectionWrapper::setRemoteDescription(const Napi::CallbackInfo &info)
|
|
231
|
+
{
|
|
232
|
+
Napi::Env env = info.Env();
|
|
233
|
+
if (!mRtcPeerConnPtr)
|
|
234
|
+
{
|
|
235
|
+
Napi::Error::New(info.Env(), "It seems peer-connection is closed").ThrowAsJavaScriptException();
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
int length = info.Length();
|
|
240
|
+
if (length < 2 || !info[0].IsString() || !info[1].IsString())
|
|
241
|
+
{
|
|
242
|
+
Napi::TypeError::New(info.Env(), "String,String expected").ThrowAsJavaScriptException();
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
std::string sdp = info[0].As<Napi::String>().ToString();
|
|
247
|
+
std::string type = info[1].As<Napi::String>().ToString();
|
|
248
|
+
|
|
249
|
+
try
|
|
250
|
+
{
|
|
251
|
+
rtc::Description desc(sdp, type);
|
|
252
|
+
mRtcPeerConnPtr->setRemoteDescription(desc);
|
|
253
|
+
}
|
|
254
|
+
catch (std::exception &ex)
|
|
255
|
+
{
|
|
256
|
+
Napi::Error::New(env, std::string("libdatachannel error while adding remote decsription # ") + ex.what()).ThrowAsJavaScriptException();
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
void PeerConnectionWrapper::addRemoteCandidate(const Napi::CallbackInfo &info)
|
|
262
|
+
{
|
|
263
|
+
Napi::Env env = info.Env();
|
|
264
|
+
if (!mRtcPeerConnPtr)
|
|
265
|
+
{
|
|
266
|
+
Napi::Error::New(info.Env(), "It seems peer-connection is closed").ThrowAsJavaScriptException();
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
int length = info.Length();
|
|
271
|
+
if (length < 2 || !info[0].IsString() || !info[1].IsString())
|
|
272
|
+
{
|
|
273
|
+
Napi::TypeError::New(info.Env(), "String,String expected").ThrowAsJavaScriptException();
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
try
|
|
278
|
+
{
|
|
279
|
+
std::string candidate = info[0].As<Napi::String>().ToString();
|
|
280
|
+
std::string mid = info[0].As<Napi::String>().ToString();
|
|
281
|
+
mRtcPeerConnPtr->addRemoteCandidate(rtc::Candidate(candidate, mid));
|
|
282
|
+
}
|
|
283
|
+
catch (std::exception &ex)
|
|
284
|
+
{
|
|
285
|
+
Napi::Error::New(env, std::string("libdatachannel error while adding remote candidate# ") + ex.what()).ThrowAsJavaScriptException();
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
Napi::Value PeerConnectionWrapper::createDataChannel(const Napi::CallbackInfo &info)
|
|
291
|
+
{
|
|
292
|
+
if (!mRtcPeerConnPtr)
|
|
293
|
+
{
|
|
294
|
+
Napi::Error::New(info.Env(), "It seems peer-connection is closed").ThrowAsJavaScriptException();
|
|
295
|
+
return info.Env().Null();
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
Napi::Env env = info.Env();
|
|
299
|
+
int length = info.Length();
|
|
300
|
+
|
|
301
|
+
if (length < 1 || !info[0].IsString())
|
|
302
|
+
{
|
|
303
|
+
Napi::TypeError::New(env, "Data Channel Label expected").ThrowAsJavaScriptException();
|
|
304
|
+
return info.Env().Null();
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
// Optional Params
|
|
308
|
+
rtc::DataChannelInit init;
|
|
309
|
+
if (length > 1)
|
|
310
|
+
{
|
|
311
|
+
if (!info[1].IsObject())
|
|
312
|
+
{
|
|
313
|
+
Napi::TypeError::New(env, "Data Channel Init Config expected(As Object)").ThrowAsJavaScriptException();
|
|
314
|
+
return info.Env().Null();
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
Napi::Object initConfig = info[1].As<Napi::Object>();
|
|
318
|
+
|
|
319
|
+
if (!initConfig.Get("protocol").IsUndefined())
|
|
320
|
+
{
|
|
321
|
+
if (!initConfig.Get("protocol").IsString())
|
|
322
|
+
{
|
|
323
|
+
Napi::TypeError::New(env, "Wrong DataChannel Init Config (protocol)").ThrowAsJavaScriptException();
|
|
324
|
+
return info.Env().Null();
|
|
325
|
+
}
|
|
326
|
+
init.protocol = initConfig.Get("protocol").As<Napi::String>();
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
if (!initConfig.Get("negotiated").IsUndefined())
|
|
330
|
+
{
|
|
331
|
+
if (!initConfig.Get("negotiated").IsBoolean())
|
|
332
|
+
{
|
|
333
|
+
Napi::TypeError::New(env, "Wrong DataChannel Init Config (negotiated)").ThrowAsJavaScriptException();
|
|
334
|
+
return info.Env().Null();
|
|
335
|
+
}
|
|
336
|
+
init.negotiated = initConfig.Get("negotiated").As<Napi::Boolean>();
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
if (!initConfig.Get("id").IsUndefined())
|
|
340
|
+
{
|
|
341
|
+
if (!initConfig.Get("id").IsNumber())
|
|
342
|
+
{
|
|
343
|
+
Napi::TypeError::New(env, "Wrong DataChannel Init Config (id)").ThrowAsJavaScriptException();
|
|
344
|
+
return info.Env().Null();
|
|
345
|
+
}
|
|
346
|
+
init.id = uint16_t(initConfig.Get("id").As<Napi::Number>().Uint32Value());
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
// Deprecated reliability object, kept for retro-compatibility
|
|
350
|
+
if (!initConfig.Get("reliability").IsUndefined())
|
|
351
|
+
{
|
|
352
|
+
if (!initConfig.Get("reliability").IsObject())
|
|
353
|
+
{
|
|
354
|
+
Napi::TypeError::New(env, "Wrong DataChannel Init Config (reliability)").ThrowAsJavaScriptException();
|
|
355
|
+
return info.Env().Null();
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
Napi::Object reliability = initConfig.Get("reliability").As<Napi::Object>();
|
|
359
|
+
if (!reliability.Get("type").IsUndefined())
|
|
360
|
+
{
|
|
361
|
+
if (!reliability.Get("type").IsNumber())
|
|
362
|
+
{
|
|
363
|
+
Napi::TypeError::New(env, "Wrong Reliability Config (type)").ThrowAsJavaScriptException();
|
|
364
|
+
return info.Env().Null();
|
|
365
|
+
}
|
|
366
|
+
switch (reliability.Get("type").As<Napi::Number>().Uint32Value())
|
|
367
|
+
{
|
|
368
|
+
case 0:
|
|
369
|
+
init.reliability.type = rtc::Reliability::Type::Reliable;
|
|
370
|
+
break;
|
|
371
|
+
case 1:
|
|
372
|
+
init.reliability.type = rtc::Reliability::Type::Rexmit;
|
|
373
|
+
break;
|
|
374
|
+
case 2:
|
|
375
|
+
init.reliability.type = rtc::Reliability::Type::Timed;
|
|
376
|
+
break;
|
|
377
|
+
default:
|
|
378
|
+
Napi::TypeError::New(env, "Unknown DataChannel Reliability Type").ThrowAsJavaScriptException();
|
|
379
|
+
return info.Env().Null();
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
if (!reliability.Get("unordered").IsUndefined())
|
|
384
|
+
{
|
|
385
|
+
if (!reliability.Get("unordered").IsBoolean())
|
|
386
|
+
{
|
|
387
|
+
Napi::TypeError::New(env, "Wrong reliability Config (unordered)").ThrowAsJavaScriptException();
|
|
388
|
+
return info.Env().Null();
|
|
389
|
+
}
|
|
390
|
+
init.reliability.unordered = reliability.Get("unordered").As<Napi::Boolean>();
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
if (!reliability.Get("rexmit").IsUndefined())
|
|
394
|
+
{
|
|
395
|
+
if (!reliability.Get("rexmit").IsNumber())
|
|
396
|
+
{
|
|
397
|
+
Napi::TypeError::New(env, "Wrong Reliability Config (rexmit)").ThrowAsJavaScriptException();
|
|
398
|
+
return info.Env().Null();
|
|
399
|
+
}
|
|
400
|
+
switch (reliability.Get("type").As<Napi::Number>().Uint32Value())
|
|
401
|
+
{
|
|
402
|
+
case 1:
|
|
403
|
+
init.reliability.rexmit = reliability.Get("rexmit").As<Napi::Number>();
|
|
404
|
+
break;
|
|
405
|
+
case 2:
|
|
406
|
+
init.reliability.rexmit = std::chrono::milliseconds(reliability.Get("rexmit").As<Napi::Number>());
|
|
407
|
+
break;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
// Reliability parameters
|
|
413
|
+
if (!initConfig.Get("ordered").IsUndefined())
|
|
414
|
+
{
|
|
415
|
+
if (!initConfig.Get("ordered").IsBoolean())
|
|
416
|
+
{
|
|
417
|
+
Napi::TypeError::New(env, "Wrong DataChannel Init Config (ordered)").ThrowAsJavaScriptException();
|
|
418
|
+
return info.Env().Null();
|
|
419
|
+
}
|
|
420
|
+
init.reliability.unordered = !initConfig.Get("ordered").As<Napi::Boolean>();
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
if(initConfig.Get("maxPacketLifeTime").IsNumber() && initConfig.Get("maxRetransmits").IsNumber())
|
|
424
|
+
{
|
|
425
|
+
Napi::TypeError::New(env, "Wrong DataChannel Init Config, maxPacketLifeTime and maxRetransmits are exclusive").ThrowAsJavaScriptException();
|
|
426
|
+
return info.Env().Null();
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
if (initConfig.Get("maxPacketLifeTime").IsNumber())
|
|
430
|
+
{
|
|
431
|
+
init.reliability.type = rtc::Reliability::Type::Timed;
|
|
432
|
+
init.reliability.rexmit = std::chrono::milliseconds(initConfig.Get("maxPacketLifeTime").As<Napi::Number>().Uint32Value());
|
|
433
|
+
}
|
|
434
|
+
else if (initConfig.Get("maxRetransmits").IsNumber())
|
|
435
|
+
{
|
|
436
|
+
init.reliability.type = rtc::Reliability::Type::Rexmit;
|
|
437
|
+
init.reliability.rexmit = int(initConfig.Get("maxRetransmits").As<Napi::Number>().Uint32Value());
|
|
438
|
+
}
|
|
439
|
+
else
|
|
440
|
+
{
|
|
441
|
+
init.reliability.type = rtc::Reliability::Type::Reliable;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
try
|
|
446
|
+
{
|
|
447
|
+
std::string label = info[0].As<Napi::String>().ToString();
|
|
448
|
+
std::shared_ptr<rtc::DataChannel> dataChannel = mRtcPeerConnPtr->createDataChannel(label, std::move(init));
|
|
449
|
+
auto instance = DataChannelWrapper::constructor.New({Napi::External<std::shared_ptr<rtc::DataChannel>>::New(info.Env(), &dataChannel)});
|
|
450
|
+
return instance;
|
|
451
|
+
}
|
|
452
|
+
catch (std::exception &ex)
|
|
453
|
+
{
|
|
454
|
+
Napi::Error::New(env, std::string("libdatachannel error while creating datachannel# ") + ex.what()).ThrowAsJavaScriptException();
|
|
455
|
+
return info.Env().Null();
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
void PeerConnectionWrapper::onLocalDescription(const Napi::CallbackInfo &info)
|
|
460
|
+
{
|
|
461
|
+
Napi::Env env = info.Env();
|
|
462
|
+
int length = info.Length();
|
|
463
|
+
|
|
464
|
+
if (length < 1 || !info[0].IsFunction())
|
|
465
|
+
{
|
|
466
|
+
Napi::TypeError::New(env, "Function expected").ThrowAsJavaScriptException();
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
// Callback
|
|
471
|
+
mOnLocalDescriptionCallback = std::make_shared<ThreadSafeCallback>(info[0].As<Napi::Function>());
|
|
472
|
+
|
|
473
|
+
mRtcPeerConnPtr->onLocalDescription([&](const rtc::Description &sdp) {
|
|
474
|
+
if (mOnLocalDescriptionCallback)
|
|
475
|
+
mOnLocalDescriptionCallback->call([sdp](Napi::Env env, std::vector<napi_value> &args) {
|
|
476
|
+
// This will run in main thread and needs to construct the
|
|
477
|
+
// arguments for the call
|
|
478
|
+
args = {
|
|
479
|
+
Napi::String::New(env, std::string(sdp)),
|
|
480
|
+
Napi::String::New(env, sdp.typeString())};
|
|
481
|
+
});
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
void PeerConnectionWrapper::onLocalCandidate(const Napi::CallbackInfo &info)
|
|
486
|
+
{
|
|
487
|
+
Napi::Env env = info.Env();
|
|
488
|
+
int length = info.Length();
|
|
489
|
+
|
|
490
|
+
if (length < 1 || !info[0].IsFunction())
|
|
491
|
+
{
|
|
492
|
+
Napi::TypeError::New(env, "Function expected").ThrowAsJavaScriptException();
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
// Callback
|
|
497
|
+
mOnLocalCandidateCallback = std::make_shared<ThreadSafeCallback>(info[0].As<Napi::Function>());
|
|
498
|
+
|
|
499
|
+
mRtcPeerConnPtr->onLocalCandidate([&](const rtc::Candidate &candidate) {
|
|
500
|
+
if (mOnLocalCandidateCallback)
|
|
501
|
+
mOnLocalCandidateCallback->call([candidate](Napi::Env env, std::vector<napi_value> &args) {
|
|
502
|
+
// This will run in main thread and needs to construct the
|
|
503
|
+
// arguments for the call
|
|
504
|
+
args = {
|
|
505
|
+
Napi::String::New(env, std::string(candidate)),
|
|
506
|
+
Napi::String::New(env, candidate.mid())};
|
|
507
|
+
});
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
void PeerConnectionWrapper::onStateChange(const Napi::CallbackInfo &info)
|
|
512
|
+
{
|
|
513
|
+
Napi::Env env = info.Env();
|
|
514
|
+
int length = info.Length();
|
|
515
|
+
|
|
516
|
+
if (length < 1 || !info[0].IsFunction())
|
|
517
|
+
{
|
|
518
|
+
Napi::TypeError::New(env, "Function expected").ThrowAsJavaScriptException();
|
|
519
|
+
return;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
// Callback
|
|
523
|
+
mOnStateChangeCallback = std::make_shared<ThreadSafeCallback>(info[0].As<Napi::Function>());
|
|
524
|
+
|
|
525
|
+
mRtcPeerConnPtr->onStateChange([&](rtc::PeerConnection::State state) {
|
|
526
|
+
if (mOnStateChangeCallback)
|
|
527
|
+
mOnStateChangeCallback->call([state](Napi::Env env, std::vector<napi_value> &args) {
|
|
528
|
+
// This will run in main thread and needs to construct the
|
|
529
|
+
// arguments for the call
|
|
530
|
+
std::ostringstream stream;
|
|
531
|
+
stream << state;
|
|
532
|
+
args = {Napi::String::New(env, stream.str())};
|
|
533
|
+
});
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
void PeerConnectionWrapper::onGatheringStateChange(const Napi::CallbackInfo &info)
|
|
538
|
+
{
|
|
539
|
+
Napi::Env env = info.Env();
|
|
540
|
+
int length = info.Length();
|
|
541
|
+
|
|
542
|
+
if (length < 1 || !info[0].IsFunction())
|
|
543
|
+
{
|
|
544
|
+
Napi::TypeError::New(env, "Function expected").ThrowAsJavaScriptException();
|
|
545
|
+
return;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
// Callback
|
|
549
|
+
mOnGatheringStateChangeCallback = std::make_shared<ThreadSafeCallback>(info[0].As<Napi::Function>());
|
|
550
|
+
|
|
551
|
+
mRtcPeerConnPtr->onGatheringStateChange([&](rtc::PeerConnection::GatheringState state) {
|
|
552
|
+
if (mOnGatheringStateChangeCallback)
|
|
553
|
+
mOnGatheringStateChangeCallback->call([state](Napi::Env env, std::vector<napi_value> &args) {
|
|
554
|
+
// This will run in main thread and needs to construct the
|
|
555
|
+
// arguments for the call
|
|
556
|
+
std::ostringstream stream;
|
|
557
|
+
stream << state;
|
|
558
|
+
args = {Napi::String::New(env, stream.str())};
|
|
559
|
+
});
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
void PeerConnectionWrapper::onDataChannel(const Napi::CallbackInfo &info)
|
|
564
|
+
{
|
|
565
|
+
Napi::Env env = info.Env();
|
|
566
|
+
int length = info.Length();
|
|
567
|
+
|
|
568
|
+
if (length < 1 || !info[0].IsFunction())
|
|
569
|
+
{
|
|
570
|
+
Napi::TypeError::New(env, "Function expected").ThrowAsJavaScriptException();
|
|
571
|
+
return;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
// Callback
|
|
575
|
+
mOnDataChannelCallback = std::make_shared<ThreadSafeCallback>(info[0].As<Napi::Function>());
|
|
576
|
+
|
|
577
|
+
mRtcPeerConnPtr->onDataChannel([&](std::shared_ptr<rtc::DataChannel> dc) {
|
|
578
|
+
if (mOnDataChannelCallback)
|
|
579
|
+
mOnDataChannelCallback->call([dc](Napi::Env env, std::vector<napi_value> &args) {
|
|
580
|
+
// This will run in main thread and needs to construct the
|
|
581
|
+
// arguments for the call
|
|
582
|
+
std::shared_ptr<rtc::DataChannel> dataChannel = dc;
|
|
583
|
+
auto instance = DataChannelWrapper::constructor.New({Napi::External<std::shared_ptr<rtc::DataChannel>>::New(env, &dataChannel)});
|
|
584
|
+
args = {instance};
|
|
585
|
+
});
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
Napi::Value PeerConnectionWrapper::bytesSent(const Napi::CallbackInfo &info)
|
|
590
|
+
{
|
|
591
|
+
Napi::Env env = info.Env();
|
|
592
|
+
if (!mRtcPeerConnPtr)
|
|
593
|
+
{
|
|
594
|
+
return Napi::Number::New(info.Env(), 0);
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
try
|
|
598
|
+
{
|
|
599
|
+
return Napi::Number::New(env, mRtcPeerConnPtr->bytesSent());
|
|
600
|
+
}
|
|
601
|
+
catch (std::exception &ex)
|
|
602
|
+
{
|
|
603
|
+
Napi::Error::New(env, std::string("libdatachannel error# ") + ex.what()).ThrowAsJavaScriptException();
|
|
604
|
+
return Napi::Number::New(info.Env(), 0);
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
Napi::Value PeerConnectionWrapper::bytesReceived(const Napi::CallbackInfo &info)
|
|
609
|
+
{
|
|
610
|
+
Napi::Env env = info.Env();
|
|
611
|
+
if (!mRtcPeerConnPtr)
|
|
612
|
+
{
|
|
613
|
+
return Napi::Number::New(info.Env(), 0);
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
try
|
|
617
|
+
{
|
|
618
|
+
return Napi::Number::New(env, mRtcPeerConnPtr->bytesReceived());
|
|
619
|
+
}
|
|
620
|
+
catch (std::exception &ex)
|
|
621
|
+
{
|
|
622
|
+
Napi::Error::New(env, std::string("libdatachannel error# ") + ex.what()).ThrowAsJavaScriptException();
|
|
623
|
+
return Napi::Number::New(info.Env(), 0);
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
Napi::Value PeerConnectionWrapper::rtt(const Napi::CallbackInfo &info)
|
|
628
|
+
{
|
|
629
|
+
Napi::Env env = info.Env();
|
|
630
|
+
if (!mRtcPeerConnPtr)
|
|
631
|
+
{
|
|
632
|
+
return Napi::Number::New(info.Env(), 0);
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
try
|
|
636
|
+
{
|
|
637
|
+
return Napi::Number::New(env, mRtcPeerConnPtr->rtt().value_or(std::chrono::milliseconds(-1)).count());
|
|
638
|
+
}
|
|
639
|
+
catch (std::exception &ex)
|
|
640
|
+
{
|
|
641
|
+
Napi::Error::New(env, std::string("libdatachannel error# ") + ex.what()).ThrowAsJavaScriptException();
|
|
642
|
+
return Napi::Number::New(info.Env(), -1);
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
Napi::Value PeerConnectionWrapper::getSelectedCandidatePair(const Napi::CallbackInfo &info)
|
|
647
|
+
{
|
|
648
|
+
Napi::Env env = info.Env();
|
|
649
|
+
if (!mRtcPeerConnPtr)
|
|
650
|
+
{
|
|
651
|
+
return Napi::Number::New(info.Env(), 0);
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
try
|
|
655
|
+
{
|
|
656
|
+
rtc::Candidate local, remote;
|
|
657
|
+
if (!mRtcPeerConnPtr->getSelectedCandidatePair(&local, &remote))
|
|
658
|
+
return info.Env().Null();
|
|
659
|
+
|
|
660
|
+
Napi::Object retvalue = Napi::Object::New(env);
|
|
661
|
+
Napi::Object localObj = Napi::Object::New(env);
|
|
662
|
+
Napi::Object remoteObj = Napi::Object::New(env);
|
|
663
|
+
|
|
664
|
+
localObj.Set("address", local.address().value_or("?"));
|
|
665
|
+
localObj.Set("port", local.port().value_or(0));
|
|
666
|
+
localObj.Set("type", candidateTypeToString(local.type()));
|
|
667
|
+
localObj.Set("transportType", candidateTransportTypeToString(local.transportType()));
|
|
668
|
+
|
|
669
|
+
remoteObj.Set("address", remote.address().value_or("?"));
|
|
670
|
+
remoteObj.Set("port", remote.port().value_or(0));
|
|
671
|
+
remoteObj.Set("type", candidateTypeToString(remote.type()));
|
|
672
|
+
remoteObj.Set("transportType", candidateTransportTypeToString(remote.transportType()));
|
|
673
|
+
|
|
674
|
+
retvalue.Set("local", localObj);
|
|
675
|
+
retvalue.Set("remote", remoteObj);
|
|
676
|
+
|
|
677
|
+
return retvalue;
|
|
678
|
+
}
|
|
679
|
+
catch (std::exception &ex)
|
|
680
|
+
{
|
|
681
|
+
Napi::Error::New(env, std::string("libdatachannel error# ") + ex.what()).ThrowAsJavaScriptException();
|
|
682
|
+
return Napi::Number::New(info.Env(), -1);
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
std::string PeerConnectionWrapper::candidateTypeToString(const rtc::Candidate::Type &type)
|
|
687
|
+
{
|
|
688
|
+
switch (type)
|
|
689
|
+
{
|
|
690
|
+
case rtc::Candidate::Type::Host:
|
|
691
|
+
return "host";
|
|
692
|
+
case rtc::Candidate::Type::PeerReflexive:
|
|
693
|
+
return "prflx";
|
|
694
|
+
case rtc::Candidate::Type::ServerReflexive:
|
|
695
|
+
return "srflx";
|
|
696
|
+
case rtc::Candidate::Type::Relayed:
|
|
697
|
+
return "relay";
|
|
698
|
+
default:
|
|
699
|
+
return "unknown";
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
std::string PeerConnectionWrapper::candidateTransportTypeToString(const rtc::Candidate::TransportType &transportType)
|
|
704
|
+
{
|
|
705
|
+
switch (transportType)
|
|
706
|
+
{
|
|
707
|
+
case rtc::Candidate::TransportType::Udp:
|
|
708
|
+
return "UDP";
|
|
709
|
+
case rtc::Candidate::TransportType::TcpActive:
|
|
710
|
+
return "TCP_active";
|
|
711
|
+
case rtc::Candidate::TransportType::TcpPassive:
|
|
712
|
+
return "TCP_passive";
|
|
713
|
+
case rtc::Candidate::TransportType::TcpSo:
|
|
714
|
+
return "TCP_so";
|
|
715
|
+
case rtc::Candidate::TransportType::TcpUnknown:
|
|
716
|
+
return "TCP_unknown";
|
|
717
|
+
default:
|
|
718
|
+
return "unknown";
|
|
719
|
+
}
|
|
720
|
+
}
|