node-datachannel 0.2.3 → 0.2.4
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 +2 -0
- package/CMakeLists.txt +2 -2
- package/lib/datachannel-stream.js +86 -0
- package/lib/index.d.ts +10 -0
- package/lib/index.js +3 -1
- package/node_modules/decompress-response/index.d.ts +14 -21
- package/node_modules/decompress-response/index.js +34 -16
- package/node_modules/decompress-response/license +1 -1
- package/node_modules/decompress-response/package.json +23 -17
- package/node_modules/decompress-response/readme.md +2 -6
- package/node_modules/detect-libc/README.md +124 -42
- package/node_modules/detect-libc/index.d.ts +11 -0
- package/node_modules/detect-libc/lib/detect-libc.js +166 -80
- package/node_modules/detect-libc/lib/process.js +16 -0
- package/node_modules/detect-libc/package.json +20 -20
- package/node_modules/{semver → lru-cache}/LICENSE +0 -0
- package/node_modules/lru-cache/README.md +166 -0
- package/node_modules/lru-cache/index.js +334 -0
- package/node_modules/lru-cache/node_modules/yallist/LICENSE +15 -0
- package/node_modules/lru-cache/node_modules/yallist/README.md +204 -0
- package/node_modules/lru-cache/node_modules/yallist/iterator.js +8 -0
- package/node_modules/lru-cache/node_modules/yallist/package.json +65 -0
- package/node_modules/lru-cache/node_modules/yallist/yallist.js +426 -0
- package/node_modules/lru-cache/package.json +74 -0
- package/node_modules/mimic-response/index.d.ts +2 -2
- package/node_modules/mimic-response/index.js +41 -2
- package/node_modules/mimic-response/package.json +17 -17
- package/node_modules/mimic-response/readme.md +22 -1
- package/node_modules/node-abi/.circleci/config.yml +63 -0
- package/node_modules/node-abi/.releaserc.json +9 -0
- package/node_modules/node-abi/abi_registry.json +45 -3
- package/node_modules/node-abi/index.js +5 -2
- package/node_modules/node-abi/node_modules/semver/CHANGELOG.md +111 -0
- package/node_modules/node-abi/node_modules/semver/LICENSE +15 -0
- package/node_modules/{semver → node-abi/node_modules/semver}/README.md +180 -26
- package/node_modules/node-abi/node_modules/semver/bin/semver.js +173 -0
- package/node_modules/node-abi/node_modules/semver/classes/comparator.js +135 -0
- package/node_modules/node-abi/node_modules/semver/classes/index.js +5 -0
- package/node_modules/node-abi/node_modules/semver/classes/range.js +510 -0
- package/node_modules/node-abi/node_modules/semver/classes/semver.js +287 -0
- package/node_modules/node-abi/node_modules/semver/functions/clean.js +6 -0
- package/node_modules/node-abi/node_modules/semver/functions/cmp.js +48 -0
- package/node_modules/node-abi/node_modules/semver/functions/coerce.js +51 -0
- package/node_modules/node-abi/node_modules/semver/functions/compare-build.js +7 -0
- package/node_modules/node-abi/node_modules/semver/functions/compare-loose.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/compare.js +5 -0
- package/node_modules/node-abi/node_modules/semver/functions/diff.js +23 -0
- package/node_modules/node-abi/node_modules/semver/functions/eq.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/gt.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/gte.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/inc.js +15 -0
- package/node_modules/node-abi/node_modules/semver/functions/lt.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/lte.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/major.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/minor.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/neq.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/parse.js +33 -0
- package/node_modules/node-abi/node_modules/semver/functions/patch.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/prerelease.js +6 -0
- package/node_modules/node-abi/node_modules/semver/functions/rcompare.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/rsort.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/satisfies.js +10 -0
- package/node_modules/node-abi/node_modules/semver/functions/sort.js +3 -0
- package/node_modules/node-abi/node_modules/semver/functions/valid.js +6 -0
- package/node_modules/node-abi/node_modules/semver/index.js +48 -0
- package/node_modules/node-abi/node_modules/semver/internal/constants.js +17 -0
- package/node_modules/node-abi/node_modules/semver/internal/debug.js +9 -0
- package/node_modules/node-abi/node_modules/semver/internal/identifiers.js +23 -0
- package/node_modules/node-abi/node_modules/semver/internal/parse-options.js +11 -0
- package/node_modules/node-abi/node_modules/semver/internal/re.js +182 -0
- package/node_modules/{semver → node-abi/node_modules/semver}/package.json +32 -23
- package/node_modules/node-abi/node_modules/semver/preload.js +2 -0
- package/node_modules/{semver → node-abi/node_modules/semver}/range.bnf +0 -0
- package/node_modules/node-abi/node_modules/semver/ranges/gtr.js +4 -0
- package/node_modules/node-abi/node_modules/semver/ranges/intersects.js +7 -0
- package/node_modules/node-abi/node_modules/semver/ranges/ltr.js +4 -0
- package/node_modules/node-abi/node_modules/semver/ranges/max-satisfying.js +25 -0
- package/node_modules/node-abi/node_modules/semver/ranges/min-satisfying.js +24 -0
- package/node_modules/node-abi/node_modules/semver/ranges/min-version.js +60 -0
- package/node_modules/node-abi/node_modules/semver/ranges/outside.js +80 -0
- package/node_modules/node-abi/node_modules/semver/ranges/simplify.js +44 -0
- package/node_modules/node-abi/node_modules/semver/ranges/subset.js +222 -0
- package/node_modules/node-abi/node_modules/semver/ranges/to-comparators.js +8 -0
- package/node_modules/node-abi/node_modules/semver/ranges/valid.js +11 -0
- package/node_modules/node-abi/package.json +20 -17
- package/node_modules/node-abi/test/index.js +7 -15
- package/node_modules/prebuild-install/CHANGELOG.md +24 -7
- package/node_modules/prebuild-install/README.md +24 -4
- package/node_modules/prebuild-install/asset.js +10 -10
- package/node_modules/prebuild-install/bin.js +13 -13
- package/node_modules/prebuild-install/download.js +22 -22
- package/node_modules/prebuild-install/log.js +4 -4
- package/node_modules/prebuild-install/package.json +18 -19
- package/node_modules/prebuild-install/proxy.js +10 -10
- package/node_modules/prebuild-install/rc.js +12 -12
- package/node_modules/prebuild-install/util.js +14 -14
- package/node_modules/simple-get/.github/dependabot.yml +15 -0
- package/node_modules/simple-get/.github/workflows/ci.yml +23 -0
- package/node_modules/simple-get/README.md +17 -3
- package/node_modules/simple-get/index.js +9 -0
- package/node_modules/simple-get/package.json +27 -13
- package/package.json +6 -5
- package/test/test.js +45 -0
- package/node_modules/detect-libc/.npmignore +0 -7
- package/node_modules/detect-libc/bin/detect-libc.js +0 -18
- package/node_modules/node-abi/.travis.yml +0 -17
- package/node_modules/semver/CHANGELOG.md +0 -39
- package/node_modules/semver/bin/semver +0 -160
- package/node_modules/semver/semver.js +0 -1483
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_args": [
|
|
3
3
|
[
|
|
4
|
-
"prebuild-install@
|
|
4
|
+
"prebuild-install@7.0.1",
|
|
5
5
|
"/home/runner/work/node-datachannel/node-datachannel"
|
|
6
6
|
]
|
|
7
7
|
],
|
|
8
|
-
"_from": "prebuild-install@
|
|
9
|
-
"_id": "prebuild-install@
|
|
8
|
+
"_from": "prebuild-install@7.0.1",
|
|
9
|
+
"_id": "prebuild-install@7.0.1",
|
|
10
10
|
"_inBundle": false,
|
|
11
|
-
"_integrity": "sha512-
|
|
11
|
+
"_integrity": "sha512-QBSab31WqkyxpnMWQxubYAHR5S9B2+r81ucocew34Fkl98FhvKIF50jIJnNOBmAZfyNV7vE5T6gd3hTVWgY6tg==",
|
|
12
12
|
"_location": "/prebuild-install",
|
|
13
13
|
"_phantomChildren": {},
|
|
14
14
|
"_requested": {
|
|
15
15
|
"type": "version",
|
|
16
16
|
"registry": true,
|
|
17
|
-
"raw": "prebuild-install@
|
|
17
|
+
"raw": "prebuild-install@7.0.1",
|
|
18
18
|
"name": "prebuild-install",
|
|
19
19
|
"escapedName": "prebuild-install",
|
|
20
|
-
"rawSpec": "
|
|
20
|
+
"rawSpec": "7.0.1",
|
|
21
21
|
"saveSpec": null,
|
|
22
|
-
"fetchSpec": "
|
|
22
|
+
"fetchSpec": "7.0.1"
|
|
23
23
|
},
|
|
24
24
|
"_requiredBy": [
|
|
25
25
|
"/"
|
|
26
26
|
],
|
|
27
|
-
"_resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-
|
|
28
|
-
"_spec": "
|
|
27
|
+
"_resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.0.1.tgz",
|
|
28
|
+
"_spec": "7.0.1",
|
|
29
29
|
"_where": "/home/runner/work/node-datachannel/node-datachannel",
|
|
30
30
|
"author": {
|
|
31
31
|
"name": "Mathias Buus",
|
|
@@ -75,32 +75,32 @@
|
|
|
75
75
|
}
|
|
76
76
|
],
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"detect-libc": "^
|
|
78
|
+
"detect-libc": "^2.0.0",
|
|
79
79
|
"expand-template": "^2.0.3",
|
|
80
80
|
"github-from-package": "0.0.0",
|
|
81
81
|
"minimist": "^1.2.3",
|
|
82
82
|
"mkdirp-classic": "^0.5.3",
|
|
83
83
|
"napi-build-utils": "^1.0.1",
|
|
84
|
-
"node-abi": "^
|
|
84
|
+
"node-abi": "^3.3.0",
|
|
85
85
|
"npmlog": "^4.0.1",
|
|
86
86
|
"pump": "^3.0.0",
|
|
87
87
|
"rc": "^1.2.7",
|
|
88
|
-
"simple-get": "^
|
|
88
|
+
"simple-get": "^4.0.0",
|
|
89
89
|
"tar-fs": "^2.0.0",
|
|
90
90
|
"tunnel-agent": "^0.6.0"
|
|
91
91
|
},
|
|
92
92
|
"description": "A command line tool to easily install prebuilt binaries for multiple version of node/iojs on a specific platform",
|
|
93
93
|
"devDependencies": {
|
|
94
94
|
"a-native-module": "^1.0.0",
|
|
95
|
-
"hallmark": "^
|
|
95
|
+
"hallmark": "^4.0.0",
|
|
96
96
|
"nock": "^10.0.6",
|
|
97
97
|
"rimraf": "^2.5.2",
|
|
98
|
-
"standard": "^
|
|
99
|
-
"tape": "^
|
|
98
|
+
"standard": "^16.0.4",
|
|
99
|
+
"tape": "^5.3.1",
|
|
100
100
|
"tempy": "0.2.1"
|
|
101
101
|
},
|
|
102
102
|
"engines": {
|
|
103
|
-
"node": ">=
|
|
103
|
+
"node": ">=10"
|
|
104
104
|
},
|
|
105
105
|
"homepage": "https://github.com/prebuild/prebuild-install",
|
|
106
106
|
"keywords": [
|
|
@@ -123,8 +123,7 @@
|
|
|
123
123
|
},
|
|
124
124
|
"scripts": {
|
|
125
125
|
"hallmark": "hallmark --fix",
|
|
126
|
-
"
|
|
127
|
-
"test": "tape test/*-test.js && npm run lint"
|
|
126
|
+
"test": "standard && hallmark && tape test/*-test.js"
|
|
128
127
|
},
|
|
129
|
-
"version": "
|
|
128
|
+
"version": "7.0.1"
|
|
130
129
|
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const url = require('url')
|
|
2
|
+
const tunnel = require('tunnel-agent')
|
|
3
|
+
const util = require('./util')
|
|
4
4
|
|
|
5
5
|
function applyProxy (reqOpts, opts) {
|
|
6
|
-
|
|
6
|
+
const log = opts.log || util.noopLogger
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
const proxy = opts['https-proxy'] || opts.proxy
|
|
9
9
|
|
|
10
10
|
if (proxy) {
|
|
11
11
|
// eslint-disable-next-line node/no-deprecated-api
|
|
12
|
-
|
|
12
|
+
const parsedDownloadUrl = url.parse(reqOpts.url)
|
|
13
13
|
// eslint-disable-next-line node/no-deprecated-api
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
const parsedProxy = url.parse(proxy)
|
|
15
|
+
const uriProtocol = (parsedDownloadUrl.protocol === 'https:' ? 'https' : 'http')
|
|
16
|
+
const proxyProtocol = (parsedProxy.protocol === 'https:' ? 'Https' : 'Http')
|
|
17
|
+
const tunnelFnName = [uriProtocol, proxyProtocol].join('Over')
|
|
18
18
|
reqOpts.agent = tunnel[tunnelFnName]({
|
|
19
19
|
proxy: {
|
|
20
20
|
host: parsedProxy.hostname,
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
const path = require('path')
|
|
2
|
+
const minimist = require('minimist')
|
|
3
|
+
const getAbi = require('node-abi').getAbi
|
|
4
|
+
const detectLibc = require('detect-libc')
|
|
5
|
+
const napi = require('napi-build-utils')
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
const env = process.env
|
|
8
|
+
const libc = env.LIBC || (detectLibc.isNonGlibcLinuxSync() && detectLibc.familySync()) || ''
|
|
9
9
|
|
|
10
10
|
// Get the configuration
|
|
11
11
|
module.exports = function (pkg) {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
const pkgConf = pkg.config || {}
|
|
13
|
+
const buildFromSource = env.npm_config_build_from_source
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
const rc = require('rc')('prebuild-install', {
|
|
16
16
|
target: pkgConf.target || env.npm_config_target || process.versions.node,
|
|
17
17
|
runtime: pkgConf.runtime || env.npm_config_runtime || 'node',
|
|
18
18
|
arch: pkgConf.arch || env.npm_config_arch || process.arch,
|
|
@@ -23,8 +23,8 @@ module.exports = function (pkg) {
|
|
|
23
23
|
verbose: env.npm_config_verbose === 'true',
|
|
24
24
|
buildFromSource: buildFromSource === pkg.name || buildFromSource === 'true',
|
|
25
25
|
path: '.',
|
|
26
|
-
proxy: env.npm_config_proxy || env
|
|
27
|
-
'https-proxy': env.npm_config_https_proxy || env
|
|
26
|
+
proxy: env.npm_config_proxy || env.http_proxy || env.HTTP_PROXY,
|
|
27
|
+
'https-proxy': env.npm_config_https_proxy || env.https_proxy || env.HTTPS_PROXY,
|
|
28
28
|
'local-address': env.npm_config_local_address,
|
|
29
29
|
'local-prebuilds': 'prebuilds',
|
|
30
30
|
'tag-prefix': 'v',
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
const path = require('path')
|
|
2
|
+
const github = require('github-from-package')
|
|
3
|
+
const home = require('os').homedir
|
|
4
|
+
const crypto = require('crypto')
|
|
5
|
+
const expandTemplate = require('expand-template')()
|
|
6
6
|
|
|
7
7
|
function getDownloadUrl (opts) {
|
|
8
|
-
|
|
8
|
+
const pkgName = opts.pkg.name.replace(/^@[a-zA-Z0-9_\-.~]+\//, '')
|
|
9
9
|
return expandTemplate(urlTemplate(opts), {
|
|
10
10
|
name: pkgName,
|
|
11
11
|
package_name: pkgName,
|
|
@@ -40,8 +40,8 @@ function urlTemplate (opts) {
|
|
|
40
40
|
return opts.download
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
const packageName = '{name}-v{version}-{runtime}-v{abi}-{platform}{libc}-{arch}.tar.gz'
|
|
44
|
+
const hostMirrorUrl = getHostMirrorUrl(opts)
|
|
45
45
|
|
|
46
46
|
if (hostMirrorUrl) {
|
|
47
47
|
return hostMirrorUrl + '/{tag_prefix}{version}/' + packageName
|
|
@@ -65,7 +65,7 @@ function getEnvPrefix (pkgName) {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
function getHostMirrorUrl (opts) {
|
|
68
|
-
|
|
68
|
+
const propName = getEnvPrefix(opts.pkg.name) + '_binary_host'
|
|
69
69
|
return process.env[propName] || process.env[propName + '_mirror']
|
|
70
70
|
}
|
|
71
71
|
|
|
@@ -74,12 +74,12 @@ function trimSlashes (str) {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
function cachedPrebuild (url) {
|
|
77
|
-
|
|
77
|
+
const digest = crypto.createHash('md5').update(url).digest('hex').slice(0, 6)
|
|
78
78
|
return path.join(prebuildCache(), digest + '-' + path.basename(url).replace(/[^a-zA-Z0-9.]+/g, '-'))
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
function npmCache () {
|
|
82
|
-
|
|
82
|
+
const env = process.env
|
|
83
83
|
return env.npm_config_cache || (env.APPDATA ? path.join(env.APPDATA, 'npm-cache') : path.join(home(), '.npm'))
|
|
84
84
|
}
|
|
85
85
|
|
|
@@ -110,12 +110,12 @@ function packageOrigin (env, pkg) {
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
function localPrebuild (url, opts) {
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
const propName = getEnvPrefix(opts.pkg.name) + '_local_prebuilds'
|
|
114
|
+
const prefix = process.env[propName] || opts['local-prebuilds'] || 'prebuilds'
|
|
115
115
|
return path.join(prefix, path.basename(url))
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
const noopLogger = {
|
|
119
119
|
http: function () {},
|
|
120
120
|
silly: function () {},
|
|
121
121
|
debug: function () {},
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: npm
|
|
4
|
+
directory: /
|
|
5
|
+
schedule:
|
|
6
|
+
interval: daily
|
|
7
|
+
labels:
|
|
8
|
+
- dependency
|
|
9
|
+
versioning-strategy: increase-if-necessary
|
|
10
|
+
- package-ecosystem: github-actions
|
|
11
|
+
directory: /
|
|
12
|
+
schedule:
|
|
13
|
+
interval: daily
|
|
14
|
+
labels:
|
|
15
|
+
- dependency
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: ci
|
|
2
|
+
'on':
|
|
3
|
+
- push
|
|
4
|
+
- pull_request
|
|
5
|
+
jobs:
|
|
6
|
+
test:
|
|
7
|
+
name: Node ${{ matrix.node }} / ${{ matrix.os }}
|
|
8
|
+
runs-on: ${{ matrix.os }}
|
|
9
|
+
strategy:
|
|
10
|
+
fail-fast: false
|
|
11
|
+
matrix:
|
|
12
|
+
os:
|
|
13
|
+
- ubuntu-latest
|
|
14
|
+
node:
|
|
15
|
+
- '14'
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v2
|
|
18
|
+
- uses: actions/setup-node@v2
|
|
19
|
+
with:
|
|
20
|
+
node-version: ${{ matrix.node }}
|
|
21
|
+
- run: npm install
|
|
22
|
+
- run: npm run build --if-present
|
|
23
|
+
- run: npm test
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
# simple-get [![
|
|
1
|
+
# simple-get [![ci][ci-image]][ci-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]
|
|
2
2
|
|
|
3
|
-
[
|
|
4
|
-
[
|
|
3
|
+
[ci-image]: https://img.shields.io/github/workflow/status/feross/simple-get/ci/master
|
|
4
|
+
[ci-url]: https://github.com/feross/simple-get/actions
|
|
5
5
|
[npm-image]: https://img.shields.io/npm/v/simple-get.svg
|
|
6
6
|
[npm-url]: https://npmjs.org/package/simple-get
|
|
7
7
|
[downloads-image]: https://img.shields.io/npm/dm/simple-get.svg
|
|
@@ -254,6 +254,20 @@ const opts = {
|
|
|
254
254
|
get(opts, function (err, res) {})
|
|
255
255
|
```
|
|
256
256
|
|
|
257
|
+
### Basic Auth
|
|
258
|
+
|
|
259
|
+
```js
|
|
260
|
+
const user = 'someuser'
|
|
261
|
+
const pass = 'pa$$word'
|
|
262
|
+
const encodedAuth = Buffer.from(`${user}:${pass}`).toString('base64')
|
|
263
|
+
|
|
264
|
+
get('http://example.com', {
|
|
265
|
+
headers: {
|
|
266
|
+
authorization: `Basic ${encodedAuth}`
|
|
267
|
+
}
|
|
268
|
+
})
|
|
269
|
+
```
|
|
270
|
+
|
|
257
271
|
### OAuth
|
|
258
272
|
|
|
259
273
|
You can use the [`oauth-1.0a`](https://github.com/ddo/oauth-1.0a) module to create
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/*! simple-get. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
1
2
|
module.exports = simpleGet
|
|
2
3
|
|
|
3
4
|
const concat = require('simple-concat')
|
|
@@ -43,6 +44,7 @@ function simpleGet (opts, cb) {
|
|
|
43
44
|
if (opts.json) opts.headers.accept = 'application/json'
|
|
44
45
|
if (opts.method) opts.method = opts.method.toUpperCase()
|
|
45
46
|
|
|
47
|
+
const originalHost = opts.hostname // hostname before potential redirect
|
|
46
48
|
const protocol = opts.protocol === 'https:' ? https : http // Support http/https urls
|
|
47
49
|
const req = protocol.request(opts, res => {
|
|
48
50
|
if (opts.followRedirects !== false && res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
|
|
@@ -50,6 +52,13 @@ function simpleGet (opts, cb) {
|
|
|
50
52
|
delete opts.headers.host // Discard `host` header on redirect (see #32)
|
|
51
53
|
res.resume() // Discard response
|
|
52
54
|
|
|
55
|
+
const redirectHost = url.parse(opts.url).hostname // eslint-disable-line node/no-deprecated-api
|
|
56
|
+
// If redirected host is different than original host, drop headers to prevent cookie leak (#73)
|
|
57
|
+
if (redirectHost !== null && redirectHost !== originalHost) {
|
|
58
|
+
delete opts.headers.cookie
|
|
59
|
+
delete opts.headers.authorization
|
|
60
|
+
}
|
|
61
|
+
|
|
53
62
|
if (opts.method === 'POST' && [301, 302].includes(res.statusCode)) {
|
|
54
63
|
opts.method = 'GET' // On 301/302 redirect, change POST to GET (see #35)
|
|
55
64
|
delete opts.headers['content-length']; delete opts.headers['content-type']
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_args": [
|
|
3
3
|
[
|
|
4
|
-
"simple-get@
|
|
4
|
+
"simple-get@4.0.1",
|
|
5
5
|
"/home/runner/work/node-datachannel/node-datachannel"
|
|
6
6
|
]
|
|
7
7
|
],
|
|
8
|
-
"_from": "simple-get@
|
|
9
|
-
"_id": "simple-get@
|
|
8
|
+
"_from": "simple-get@4.0.1",
|
|
9
|
+
"_id": "simple-get@4.0.1",
|
|
10
10
|
"_inBundle": false,
|
|
11
|
-
"_integrity": "sha512-
|
|
11
|
+
"_integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==",
|
|
12
12
|
"_location": "/simple-get",
|
|
13
13
|
"_phantomChildren": {},
|
|
14
14
|
"_requested": {
|
|
15
15
|
"type": "version",
|
|
16
16
|
"registry": true,
|
|
17
|
-
"raw": "simple-get@
|
|
17
|
+
"raw": "simple-get@4.0.1",
|
|
18
18
|
"name": "simple-get",
|
|
19
19
|
"escapedName": "simple-get",
|
|
20
|
-
"rawSpec": "
|
|
20
|
+
"rawSpec": "4.0.1",
|
|
21
21
|
"saveSpec": null,
|
|
22
|
-
"fetchSpec": "
|
|
22
|
+
"fetchSpec": "4.0.1"
|
|
23
23
|
},
|
|
24
24
|
"_requiredBy": [
|
|
25
25
|
"/prebuild-install"
|
|
26
26
|
],
|
|
27
|
-
"_resolved": "https://registry.npmjs.org/simple-get/-/simple-get-
|
|
28
|
-
"_spec": "
|
|
27
|
+
"_resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz",
|
|
28
|
+
"_spec": "4.0.1",
|
|
29
29
|
"_where": "/home/runner/work/node-datachannel/node-datachannel",
|
|
30
30
|
"author": {
|
|
31
31
|
"name": "Feross Aboukhadijeh",
|
|
32
32
|
"email": "feross@feross.org",
|
|
33
|
-
"url": "
|
|
33
|
+
"url": "https://feross.org"
|
|
34
34
|
},
|
|
35
35
|
"browser": {
|
|
36
36
|
"decompress-response": false
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"url": "https://github.com/feross/simple-get/issues"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"decompress-response": "^
|
|
42
|
+
"decompress-response": "^6.0.0",
|
|
43
43
|
"once": "^1.3.1",
|
|
44
44
|
"simple-concat": "^1.0.0"
|
|
45
45
|
},
|
|
@@ -48,8 +48,22 @@
|
|
|
48
48
|
"self-signed-https": "^1.0.5",
|
|
49
49
|
"standard": "*",
|
|
50
50
|
"string-to-stream": "^3.0.0",
|
|
51
|
-
"tape": "^
|
|
51
|
+
"tape": "^5.0.0"
|
|
52
52
|
},
|
|
53
|
+
"funding": [
|
|
54
|
+
{
|
|
55
|
+
"type": "github",
|
|
56
|
+
"url": "https://github.com/sponsors/feross"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"type": "patreon",
|
|
60
|
+
"url": "https://www.patreon.com/feross"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"type": "consulting",
|
|
64
|
+
"url": "https://feross.org/support"
|
|
65
|
+
}
|
|
66
|
+
],
|
|
53
67
|
"homepage": "https://github.com/feross/simple-get",
|
|
54
68
|
"keywords": [
|
|
55
69
|
"request",
|
|
@@ -77,5 +91,5 @@
|
|
|
77
91
|
"scripts": {
|
|
78
92
|
"test": "standard && tape test/*.js"
|
|
79
93
|
},
|
|
80
|
-
"version": "
|
|
94
|
+
"version": "4.0.1"
|
|
81
95
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-datachannel",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "libdatachannel node bindings",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -46,17 +46,18 @@
|
|
|
46
46
|
},
|
|
47
47
|
"homepage": "https://github.com/murat-dogan/node-datachannel#readme",
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"cmake-js": "^6.
|
|
50
|
-
"jest": "^27.
|
|
49
|
+
"cmake-js": "^6.3.0",
|
|
50
|
+
"jest": "^27.5.1",
|
|
51
51
|
"nan": "^2.15.0",
|
|
52
52
|
"napi-thread-safe-callback-cancellable": "^0.0.7",
|
|
53
53
|
"node-addon-api": "^4.2.0",
|
|
54
|
-
"prebuild": "^11.0.
|
|
54
|
+
"prebuild": "^11.0.3"
|
|
55
55
|
},
|
|
56
56
|
"bundledDependencies": [
|
|
57
57
|
"prebuild-install"
|
|
58
58
|
],
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"
|
|
60
|
+
"@types/node": "^17.0.21",
|
|
61
|
+
"prebuild-install": "^7.0.1"
|
|
61
62
|
}
|
|
62
63
|
}
|
package/test/test.js
CHANGED
|
@@ -145,4 +145,49 @@ describe('P2P', () => {
|
|
|
145
145
|
}, 12 * 1000);
|
|
146
146
|
|
|
147
147
|
});
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
function waitForGathering(peer) {
|
|
151
|
+
return new Promise((resolve) => {
|
|
152
|
+
peer.onGatheringStateChange((state) => {
|
|
153
|
+
if (state === 'complete') resolve();
|
|
154
|
+
});
|
|
155
|
+
// Handle race conditions where gathering has already completed
|
|
156
|
+
if (peer.gatheringState() === 'complete') resolve();
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
describe('DataChannel streams', () => {
|
|
161
|
+
|
|
162
|
+
test('can build an echo pipeline', async () => {
|
|
163
|
+
let clientPeer = new nodeDataChannel.PeerConnection("Client", { iceServers: [] });
|
|
164
|
+
let echoPeer = new nodeDataChannel.PeerConnection("Client", { iceServers: [] });
|
|
165
|
+
|
|
166
|
+
const echoStream = new nodeDataChannel.DataChannelStream(
|
|
167
|
+
echoPeer.createDataChannel("echo-channel")
|
|
168
|
+
);
|
|
169
|
+
echoStream.pipe(echoStream); // Echo all received data back to the client
|
|
170
|
+
|
|
171
|
+
await waitForGathering(echoPeer);
|
|
172
|
+
|
|
173
|
+
const { sdp: echoDescSdp, type: echoDescType } = echoPeer.localDescription();
|
|
174
|
+
clientPeer.setRemoteDescription(echoDescSdp, echoDescType);
|
|
175
|
+
await waitForGathering(clientPeer);
|
|
176
|
+
|
|
177
|
+
const { sdp: clientDescSdp, type: clientDescType } = clientPeer.localDescription();
|
|
178
|
+
echoPeer.setRemoteDescription(clientDescSdp, clientDescType);
|
|
179
|
+
|
|
180
|
+
const clientChannel = await new Promise((resolve) => clientPeer.onDataChannel(resolve));
|
|
181
|
+
|
|
182
|
+
const clientResponsePromise = new Promise((resolve) => clientChannel.onMessage(resolve));
|
|
183
|
+
clientChannel.sendMessage("test message");
|
|
184
|
+
|
|
185
|
+
expect(await clientResponsePromise).toBe("test message");
|
|
186
|
+
|
|
187
|
+
clientChannel.close();
|
|
188
|
+
await new Promise((resolve) => echoStream.on('end', resolve));
|
|
189
|
+
|
|
190
|
+
clientPeer.close();
|
|
191
|
+
echoPeer.close();
|
|
192
|
+
});
|
|
148
193
|
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
'use strict';
|
|
4
|
-
|
|
5
|
-
var spawnSync = require('child_process').spawnSync;
|
|
6
|
-
var libc = require('../');
|
|
7
|
-
|
|
8
|
-
var spawnOptions = {
|
|
9
|
-
env: process.env,
|
|
10
|
-
shell: true,
|
|
11
|
-
stdio: 'inherit'
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
if (libc.isNonGlibcLinux) {
|
|
15
|
-
spawnOptions.env.LIBC = process.env.LIBC || libc.family;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
process.exit(spawnSync(process.argv[2], process.argv.slice(3), spawnOptions).status);
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
language: node_js
|
|
2
|
-
cache:
|
|
3
|
-
directories:
|
|
4
|
-
- ~/.npm
|
|
5
|
-
notifications:
|
|
6
|
-
email: false
|
|
7
|
-
node_js:
|
|
8
|
-
- '14'
|
|
9
|
-
- '12'
|
|
10
|
-
- '10'
|
|
11
|
-
- '9'
|
|
12
|
-
- '8'
|
|
13
|
-
after_success:
|
|
14
|
-
- npm run travis-deploy-once "npm run semantic-release"
|
|
15
|
-
branches:
|
|
16
|
-
except:
|
|
17
|
-
- /^v\d+\.\d+\.\d+$/
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# changes log
|
|
2
|
-
|
|
3
|
-
## 5.7
|
|
4
|
-
|
|
5
|
-
* Add `minVersion` method
|
|
6
|
-
|
|
7
|
-
## 5.6
|
|
8
|
-
|
|
9
|
-
* Move boolean `loose` param to an options object, with
|
|
10
|
-
backwards-compatibility protection.
|
|
11
|
-
* Add ability to opt out of special prerelease version handling with
|
|
12
|
-
the `includePrerelease` option flag.
|
|
13
|
-
|
|
14
|
-
## 5.5
|
|
15
|
-
|
|
16
|
-
* Add version coercion capabilities
|
|
17
|
-
|
|
18
|
-
## 5.4
|
|
19
|
-
|
|
20
|
-
* Add intersection checking
|
|
21
|
-
|
|
22
|
-
## 5.3
|
|
23
|
-
|
|
24
|
-
* Add `minSatisfying` method
|
|
25
|
-
|
|
26
|
-
## 5.2
|
|
27
|
-
|
|
28
|
-
* Add `prerelease(v)` that returns prerelease components
|
|
29
|
-
|
|
30
|
-
## 5.1
|
|
31
|
-
|
|
32
|
-
* Add Backus-Naur for ranges
|
|
33
|
-
* Remove excessively cute inspection methods
|
|
34
|
-
|
|
35
|
-
## 5.0
|
|
36
|
-
|
|
37
|
-
* Remove AMD/Browserified build artifacts
|
|
38
|
-
* Fix ltr and gtr when using the `*` range
|
|
39
|
-
* Fix for range `*` with a prerelease identifier
|