diff --git a/.idea/deployment.xml b/.idea/deployment.xml
new file mode 100755
index 0000000..e6fd54c
--- /dev/null
+++ b/.idea/deployment.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100755
index 0000000..28a804d
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100755
index 0000000..bcdb2f0
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100755
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/webRTC-to-stream.iml b/.idea/webRTC-to-stream.iml
new file mode 100755
index 0000000..c956989
--- /dev/null
+++ b/.idea/webRTC-to-stream.iml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/webServers.xml b/.idea/webServers.xml
new file mode 100755
index 0000000..ae65af2
--- /dev/null
+++ b/.idea/webServers.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100755
index 0000000..8810a57
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,225 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ initConnection
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+ false
+ true
+ true
+
+
+ true
+ DEFINITION_ORDER
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1527596922723
+
+
+ 1527596922723
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
old mode 100644
new mode 100755
index e00251c..3972d08
--- a/package-lock.json
+++ b/package-lock.json
@@ -9,7 +9,7 @@
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz",
"integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=",
"requires": {
- "mime-types": "2.1.18",
+ "mime-types": "~2.1.18",
"negotiator": "0.6.1"
}
},
@@ -23,7 +23,7 @@
"resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-3.4.1.tgz",
"integrity": "sha512-MPIwsZU9PP9kOrZpyu2042kYA8Fdt/AedQYkYXucHgF9QoD9dXVp0ypuGnHXSR0hTstBxdt85Xkh4JolYfK5wg==",
"requires": {
- "humanize-ms": "1.2.1"
+ "humanize-ms": "^1.2.1"
}
},
"ajv": {
@@ -31,10 +31,10 @@
"resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz",
"integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=",
"requires": {
- "co": "4.6.0",
- "fast-deep-equal": "1.1.0",
- "fast-json-stable-stringify": "2.0.0",
- "json-schema-traverse": "0.3.1"
+ "co": "^4.6.0",
+ "fast-deep-equal": "^1.0.0",
+ "fast-json-stable-stringify": "^2.0.0",
+ "json-schema-traverse": "^0.3.0"
}
},
"array-flatten": {
@@ -62,7 +62,7 @@
"resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz",
"integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==",
"requires": {
- "lodash": "4.17.10"
+ "lodash": "^4.17.10"
}
},
"async-limiter": {
@@ -90,8 +90,8 @@
"resolved": "https://registry.npmjs.org/axios/-/axios-0.18.0.tgz",
"integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=",
"requires": {
- "follow-redirects": "1.5.0",
- "is-buffer": "1.1.6"
+ "follow-redirects": "^1.3.0",
+ "is-buffer": "^1.1.5"
}
},
"backo2": {
@@ -115,7 +115,7 @@
"integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=",
"optional": true,
"requires": {
- "tweetnacl": "0.14.5"
+ "tweetnacl": "^0.14.3"
}
},
"better-assert": {
@@ -137,15 +137,15 @@
"integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=",
"requires": {
"bytes": "3.0.0",
- "content-type": "1.0.4",
+ "content-type": "~1.0.4",
"debug": "2.6.9",
- "depd": "1.1.2",
- "http-errors": "1.6.3",
+ "depd": "~1.1.1",
+ "http-errors": "~1.6.2",
"iconv-lite": "0.4.19",
- "on-finished": "2.3.0",
+ "on-finished": "~2.3.0",
"qs": "6.5.1",
"raw-body": "2.3.2",
- "type-is": "1.6.16"
+ "type-is": "~1.6.15"
}
},
"bytes": {
@@ -173,7 +173,7 @@
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz",
"integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=",
"requires": {
- "delayed-stream": "1.0.0"
+ "delayed-stream": "~1.0.0"
}
},
"component-bind": {
@@ -221,7 +221,7 @@
"resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz",
"integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=",
"requires": {
- "assert-plus": "1.0.0"
+ "assert-plus": "^1.0.0"
}
},
"debug": {
@@ -253,7 +253,7 @@
"integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=",
"optional": true,
"requires": {
- "jsbn": "0.1.1"
+ "jsbn": "~0.1.0"
}
},
"ee-first": {
@@ -276,12 +276,12 @@
"resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.2.0.tgz",
"integrity": "sha512-mRbgmAtQ4GAlKwuPnnAvXXwdPhEx+jkc0OBCLrXuD/CRvwNK3AxRSnqK4FSqmAMRRHryVJP8TopOvmEaA64fKw==",
"requires": {
- "accepts": "1.3.5",
+ "accepts": "~1.3.4",
"base64id": "1.0.0",
"cookie": "0.3.1",
- "debug": "3.1.0",
- "engine.io-parser": "2.1.2",
- "ws": "3.3.3"
+ "debug": "~3.1.0",
+ "engine.io-parser": "~2.1.0",
+ "ws": "~3.3.1"
},
"dependencies": {
"debug": {
@@ -301,14 +301,14 @@
"requires": {
"component-emitter": "1.2.1",
"component-inherit": "0.0.3",
- "debug": "3.1.0",
- "engine.io-parser": "2.1.2",
+ "debug": "~3.1.0",
+ "engine.io-parser": "~2.1.1",
"has-cors": "1.1.0",
"indexof": "0.0.1",
"parseqs": "0.0.5",
"parseuri": "0.0.5",
- "ws": "3.3.3",
- "xmlhttprequest-ssl": "1.5.5",
+ "ws": "~3.3.1",
+ "xmlhttprequest-ssl": "~1.5.4",
"yeast": "0.1.2"
},
"dependencies": {
@@ -328,10 +328,10 @@
"integrity": "sha512-dInLFzr80RijZ1rGpx1+56/uFoH7/7InhH3kZt+Ms6hT8tNx3NGW/WNSA/f8As1WkOfkuyb3tnRyuXGxusclMw==",
"requires": {
"after": "0.8.2",
- "arraybuffer.slice": "0.0.7",
+ "arraybuffer.slice": "~0.0.7",
"base64-arraybuffer": "0.1.5",
"blob": "0.0.4",
- "has-binary2": "1.0.3"
+ "has-binary2": "~1.0.2"
}
},
"escape-html": {
@@ -349,36 +349,36 @@
"resolved": "https://registry.npmjs.org/express/-/express-4.16.3.tgz",
"integrity": "sha1-avilAjUNsyRuzEvs9rWjTSL37VM=",
"requires": {
- "accepts": "1.3.5",
+ "accepts": "~1.3.5",
"array-flatten": "1.1.1",
"body-parser": "1.18.2",
"content-disposition": "0.5.2",
- "content-type": "1.0.4",
+ "content-type": "~1.0.4",
"cookie": "0.3.1",
"cookie-signature": "1.0.6",
"debug": "2.6.9",
- "depd": "1.1.2",
- "encodeurl": "1.0.2",
- "escape-html": "1.0.3",
- "etag": "1.8.1",
+ "depd": "~1.1.2",
+ "encodeurl": "~1.0.2",
+ "escape-html": "~1.0.3",
+ "etag": "~1.8.1",
"finalhandler": "1.1.1",
"fresh": "0.5.2",
"merge-descriptors": "1.0.1",
- "methods": "1.1.2",
- "on-finished": "2.3.0",
- "parseurl": "1.3.2",
+ "methods": "~1.1.2",
+ "on-finished": "~2.3.0",
+ "parseurl": "~1.3.2",
"path-to-regexp": "0.1.7",
- "proxy-addr": "2.0.3",
+ "proxy-addr": "~2.0.3",
"qs": "6.5.1",
- "range-parser": "1.2.0",
+ "range-parser": "~1.2.0",
"safe-buffer": "5.1.1",
"send": "0.16.2",
"serve-static": "1.13.2",
"setprototypeof": "1.1.0",
- "statuses": "1.4.0",
- "type-is": "1.6.16",
+ "statuses": "~1.4.0",
+ "type-is": "~1.6.16",
"utils-merge": "1.0.1",
- "vary": "1.1.2"
+ "vary": "~1.1.2"
}
},
"extend": {
@@ -407,12 +407,12 @@
"integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==",
"requires": {
"debug": "2.6.9",
- "encodeurl": "1.0.2",
- "escape-html": "1.0.3",
- "on-finished": "2.3.0",
- "parseurl": "1.3.2",
- "statuses": "1.4.0",
- "unpipe": "1.0.0"
+ "encodeurl": "~1.0.2",
+ "escape-html": "~1.0.3",
+ "on-finished": "~2.3.0",
+ "parseurl": "~1.3.2",
+ "statuses": "~1.4.0",
+ "unpipe": "~1.0.0"
}
},
"fluent-ffmpeg": {
@@ -420,8 +420,8 @@
"resolved": "https://registry.npmjs.org/fluent-ffmpeg/-/fluent-ffmpeg-2.1.2.tgz",
"integrity": "sha1-yVLeIkD4EuvaCqgAbXd27irPfXQ=",
"requires": {
- "async": "2.6.1",
- "which": "1.3.1"
+ "async": ">=0.2.9",
+ "which": "^1.1.1"
}
},
"follow-redirects": {
@@ -429,7 +429,7 @@
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.0.tgz",
"integrity": "sha512-fdrt472/9qQ6Kgjvb935ig6vJCuofpBUD14f9Vb+SLlm7xIe4Qva5gey8EKtv8lp7ahE1wilg3xL1znpVGtZIA==",
"requires": {
- "debug": "3.1.0"
+ "debug": "^3.1.0"
},
"dependencies": {
"debug": {
@@ -452,9 +452,9 @@
"resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz",
"integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=",
"requires": {
- "asynckit": "0.4.0",
+ "asynckit": "^0.4.0",
"combined-stream": "1.0.6",
- "mime-types": "2.1.18"
+ "mime-types": "^2.1.12"
}
},
"forwarded": {
@@ -472,7 +472,7 @@
"resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
"integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=",
"requires": {
- "assert-plus": "1.0.0"
+ "assert-plus": "^1.0.0"
}
},
"har-schema": {
@@ -485,8 +485,8 @@
"resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz",
"integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=",
"requires": {
- "ajv": "5.5.2",
- "har-schema": "2.0.0"
+ "ajv": "^5.1.0",
+ "har-schema": "^2.0.0"
}
},
"has-binary2": {
@@ -507,10 +507,10 @@
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz",
"integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=",
"requires": {
- "depd": "1.1.2",
+ "depd": "~1.1.2",
"inherits": "2.0.3",
"setprototypeof": "1.1.0",
- "statuses": "1.4.0"
+ "statuses": ">= 1.4.0 < 2"
}
},
"http-signature": {
@@ -518,9 +518,9 @@
"resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz",
"integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=",
"requires": {
- "assert-plus": "1.0.0",
- "jsprim": "1.4.1",
- "sshpk": "1.14.1"
+ "assert-plus": "^1.0.0",
+ "jsprim": "^1.2.2",
+ "sshpk": "^1.7.0"
}
},
"humanize-ms": {
@@ -528,7 +528,7 @@
"resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz",
"integrity": "sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=",
"requires": {
- "ms": "2.0.0"
+ "ms": "^2.0.0"
}
},
"iconv-lite": {
@@ -643,7 +643,7 @@
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz",
"integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==",
"requires": {
- "mime-db": "1.33.0"
+ "mime-db": "~1.33.0"
}
},
"ms": {
@@ -679,7 +679,7 @@
"resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz",
"integrity": "sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0=",
"requires": {
- "better-assert": "1.0.2"
+ "better-assert": "~1.0.0"
}
},
"parseuri": {
@@ -687,7 +687,7 @@
"resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz",
"integrity": "sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo=",
"requires": {
- "better-assert": "1.0.2"
+ "better-assert": "~1.0.0"
}
},
"parseurl": {
@@ -710,7 +710,7 @@
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.3.tgz",
"integrity": "sha512-jQTChiCJteusULxjBp8+jftSQE5Obdl3k4cnmLA6WXtK6XFuWRnvVL7aCiBqaLPM8c4ph0S4tKna8XvmIwEnXQ==",
"requires": {
- "forwarded": "0.1.2",
+ "forwarded": "~0.1.2",
"ipaddr.js": "1.6.0"
}
},
@@ -753,7 +753,7 @@
"depd": "1.1.1",
"inherits": "2.0.3",
"setprototypeof": "1.0.3",
- "statuses": "1.4.0"
+ "statuses": ">= 1.3.1 < 2"
}
},
"setprototypeof": {
@@ -768,26 +768,26 @@
"resolved": "https://registry.npmjs.org/request/-/request-2.87.0.tgz",
"integrity": "sha512-fcogkm7Az5bsS6Sl0sibkbhcKsnyon/jV1kF3ajGmF0c8HrttdKTPRT9hieOaQHA5HEq6r8OyWOo/o781C1tNw==",
"requires": {
- "aws-sign2": "0.7.0",
- "aws4": "1.7.0",
- "caseless": "0.12.0",
- "combined-stream": "1.0.6",
- "extend": "3.0.1",
- "forever-agent": "0.6.1",
- "form-data": "2.3.2",
- "har-validator": "5.0.3",
- "http-signature": "1.2.0",
- "is-typedarray": "1.0.0",
- "isstream": "0.1.2",
- "json-stringify-safe": "5.0.1",
- "mime-types": "2.1.18",
- "oauth-sign": "0.8.2",
- "performance-now": "2.1.0",
- "qs": "6.5.1",
- "safe-buffer": "5.1.1",
- "tough-cookie": "2.3.4",
- "tunnel-agent": "0.6.0",
- "uuid": "3.2.1"
+ "aws-sign2": "~0.7.0",
+ "aws4": "^1.6.0",
+ "caseless": "~0.12.0",
+ "combined-stream": "~1.0.5",
+ "extend": "~3.0.1",
+ "forever-agent": "~0.6.1",
+ "form-data": "~2.3.1",
+ "har-validator": "~5.0.3",
+ "http-signature": "~1.2.0",
+ "is-typedarray": "~1.0.0",
+ "isstream": "~0.1.2",
+ "json-stringify-safe": "~5.0.1",
+ "mime-types": "~2.1.17",
+ "oauth-sign": "~0.8.2",
+ "performance-now": "^2.1.0",
+ "qs": "~6.5.1",
+ "safe-buffer": "^5.1.1",
+ "tough-cookie": "~2.3.3",
+ "tunnel-agent": "^0.6.0",
+ "uuid": "^3.1.0"
}
},
"safe-buffer": {
@@ -801,18 +801,18 @@
"integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==",
"requires": {
"debug": "2.6.9",
- "depd": "1.1.2",
- "destroy": "1.0.4",
- "encodeurl": "1.0.2",
- "escape-html": "1.0.3",
- "etag": "1.8.1",
+ "depd": "~1.1.2",
+ "destroy": "~1.0.4",
+ "encodeurl": "~1.0.2",
+ "escape-html": "~1.0.3",
+ "etag": "~1.8.1",
"fresh": "0.5.2",
- "http-errors": "1.6.3",
+ "http-errors": "~1.6.2",
"mime": "1.4.1",
"ms": "2.0.0",
- "on-finished": "2.3.0",
- "range-parser": "1.2.0",
- "statuses": "1.4.0"
+ "on-finished": "~2.3.0",
+ "range-parser": "~1.2.0",
+ "statuses": "~1.4.0"
}
},
"serve-static": {
@@ -820,9 +820,9 @@
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz",
"integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==",
"requires": {
- "encodeurl": "1.0.2",
- "escape-html": "1.0.3",
- "parseurl": "1.3.2",
+ "encodeurl": "~1.0.2",
+ "escape-html": "~1.0.3",
+ "parseurl": "~1.3.2",
"send": "0.16.2"
}
},
@@ -836,12 +836,12 @@
"resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.1.1.tgz",
"integrity": "sha512-rORqq9c+7W0DAK3cleWNSyfv/qKXV99hV4tZe+gGLfBECw3XEhBy7x85F3wypA9688LKjtwO9pX9L33/xQI8yA==",
"requires": {
- "debug": "3.1.0",
- "engine.io": "3.2.0",
- "has-binary2": "1.0.3",
- "socket.io-adapter": "1.1.1",
+ "debug": "~3.1.0",
+ "engine.io": "~3.2.0",
+ "has-binary2": "~1.0.2",
+ "socket.io-adapter": "~1.1.0",
"socket.io-client": "2.1.1",
- "socket.io-parser": "3.2.0"
+ "socket.io-parser": "~3.2.0"
},
"dependencies": {
"debug": {
@@ -868,15 +868,15 @@
"base64-arraybuffer": "0.1.5",
"component-bind": "1.0.0",
"component-emitter": "1.2.1",
- "debug": "3.1.0",
- "engine.io-client": "3.2.1",
- "has-binary2": "1.0.3",
+ "debug": "~3.1.0",
+ "engine.io-client": "~3.2.0",
+ "has-binary2": "~1.0.2",
"has-cors": "1.1.0",
"indexof": "0.0.1",
"object-component": "0.0.3",
"parseqs": "0.0.5",
"parseuri": "0.0.5",
- "socket.io-parser": "3.2.0",
+ "socket.io-parser": "~3.2.0",
"to-array": "0.1.4"
},
"dependencies": {
@@ -896,7 +896,7 @@
"integrity": "sha512-FYiBx7rc/KORMJlgsXysflWx/RIvtqZbyGLlHZvjfmPTPeuD/I8MaW7cfFrj5tRltICJdgwflhfZ3NVVbVLFQA==",
"requires": {
"component-emitter": "1.2.1",
- "debug": "3.1.0",
+ "debug": "~3.1.0",
"isarray": "2.0.1"
},
"dependencies": {
@@ -915,14 +915,14 @@
"resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.1.tgz",
"integrity": "sha1-Ew9Zde3a2WPx1W+SuaxsUfqfg+s=",
"requires": {
- "asn1": "0.2.3",
- "assert-plus": "1.0.0",
- "bcrypt-pbkdf": "1.0.1",
- "dashdash": "1.14.1",
- "ecc-jsbn": "0.1.1",
- "getpass": "0.1.7",
- "jsbn": "0.1.1",
- "tweetnacl": "0.14.5"
+ "asn1": "~0.2.3",
+ "assert-plus": "^1.0.0",
+ "bcrypt-pbkdf": "^1.0.0",
+ "dashdash": "^1.12.0",
+ "ecc-jsbn": "~0.1.1",
+ "getpass": "^0.1.1",
+ "jsbn": "~0.1.0",
+ "tweetnacl": "~0.14.0"
}
},
"statuses": {
@@ -935,7 +935,7 @@
"resolved": "https://registry.npmjs.org/stream/-/stream-0.0.2.tgz",
"integrity": "sha1-f1Nj8Ff2WSxVlfALyAon9c7B8O8=",
"requires": {
- "emitter-component": "1.1.1"
+ "emitter-component": "^1.1.1"
}
},
"to-array": {
@@ -948,7 +948,7 @@
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz",
"integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==",
"requires": {
- "punycode": "1.4.1"
+ "punycode": "^1.4.1"
}
},
"tunnel-agent": {
@@ -956,7 +956,7 @@
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
"integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=",
"requires": {
- "safe-buffer": "5.1.1"
+ "safe-buffer": "^5.0.1"
}
},
"tweetnacl": {
@@ -971,7 +971,7 @@
"integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==",
"requires": {
"media-typer": "0.3.0",
- "mime-types": "2.1.18"
+ "mime-types": "~2.1.18"
}
},
"ultron": {
@@ -1004,9 +1004,9 @@
"resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz",
"integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=",
"requires": {
- "assert-plus": "1.0.0",
+ "assert-plus": "^1.0.0",
"core-util-is": "1.0.2",
- "extsprintf": "1.3.0"
+ "extsprintf": "^1.2.0"
}
},
"which": {
@@ -1014,7 +1014,7 @@
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
"requires": {
- "isexe": "2.0.0"
+ "isexe": "^2.0.0"
}
},
"ws": {
@@ -1022,9 +1022,9 @@
"resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz",
"integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==",
"requires": {
- "async-limiter": "1.0.0",
- "safe-buffer": "5.1.1",
- "ultron": "1.1.1"
+ "async-limiter": "~1.0.0",
+ "safe-buffer": "~5.1.0",
+ "ultron": "~1.1.0"
}
},
"xmlhttprequest-ssl": {
diff --git a/server-test.js b/server-test.js
new file mode 100755
index 0000000..9ea5178
--- /dev/null
+++ b/server-test.js
@@ -0,0 +1,160 @@
+const path = require('path');
+const url = require('url');
+const express = require('express');
+const fs = require('fs');
+const http = require('http');
+const io = require('socket.io');
+const app = express();
+const agent = require('agentkeepalive');
+const request = require('request');
+
+const port = 8443;
+const server = http.createServer(app).listen(port, function() {
+ console.log('Open http://localhost:' + port + '/ with a browser');
+});
+
+
+// TEST PROMISE
+const readFile = (path, opts = 'utf8') =>
+ new Promise((res, rej) => {
+ fs.readFile(path, opts, (err, data) => {
+ if (err) rej(err)
+ else res(data)
+ })
+ });
+
+
+
+// CORS
+app.use((req, res, next) => {
+ res.setHeader('Access-Control-Allow-Origin', '*');
+ next();
+});
+
+app.use(express.static(path.join(__dirname, 'static')));
+
+const socket = io(server);
+
+let streamerId = '';
+let streamOnline = false;
+let req;
+
+socket.on('connection', async (socket) => {
+ console.log('Connected ' + socket.id);
+
+ socket.on('error', (error) => {
+ console.error('Connection ' + socket.id + ' error', error);
+ });
+
+ socket.on('disconnect',(data) => {
+ if(streamerId == socket.id){
+ console.log('Stream offline! ' + streamerId+ ' closed');
+ } else {
+ console.log('Connection ' + socket.id + ' closed');
+ }
+ });
+
+
+ socket.on('stream', (data) => {
+ streamerId = socket.id;
+ streamOnline = true;
+ console.log('Stream active! Session ' + streamerId);
+ });
+
+ const onNewChunk = () => {
+ new Promise((res, rej) => {
+ socket.on('blob', (data) => {
+ if(data){
+ res(data)
+ }
+ else {
+ rej(data);
+ }
+ })
+ })
+ };
+
+
+
+});
+
+
+const initConnection = async () => {
+ const options = {
+ method: 'PUT',
+ forever: true,
+ uri: 'http://ws.kurento.fishrungames.com:8000/'+ 'qq' + '.ogv',
+ headers: {
+ 'Connection': 'keep-alive',
+ 'content-type': 'video/ogv',
+ 'ice-Public': '1',
+ 'ice-Name': 'Stream' + 'qq',
+ 'ice-Description': 'Steam' + 'qq',
+ 'Expect': '100-continue',
+ 'Accept': '*/*'
+ },
+ auth: {
+ user: 'source',
+ password: 'frg$$frg'
+ }
+ };
+ fs.createReadStream('new.ogv').pipe(request.put(options, (error, response, body) =>
+ {
+ if(error){
+ console.log(error);
+ }
+
+ console.log('end');
+
+ }));
+ console.log('eng');
+
+ /*req = request(options, (err, message, data) => {
+ if(err)
+ console.log(err)
+
+ //console.log(message);
+ //console.log(data);
+ });*/
+};
+
+const job = async()=> {
+ console.log('Init');
+ let end = await initConnection();
+ //req.write(await readFile('new.webm'));
+
+};
+
+job();
+app.get('/video', function(req, res) {
+ const path = 'new.webm';
+ const stat = fs.statSync(path);
+ const fileSize = stat.size;
+ const range = req.headers.range;
+ if (range) {
+ const parts = range.replace(/bytes=/, "").split("-");
+ const start = parseInt(parts[0], 10);
+ const end = parts[1]
+ ? parseInt(parts[1], 10)
+ : fileSize-1;
+ const chunksize = (end-start)+1;
+ const file = fs.createReadStream(path, {start, end});
+ const head = {
+ 'Content-Range': `bytes ${start}-${end}/${fileSize}`,
+ 'Accept-Ranges': 'bytes',
+ 'Content-Length': chunksize,
+ 'Content-Type': 'video/webm',
+ };
+ res.writeHead(206, head);
+ file.pipe(res);
+ } else {
+ const head = {
+ 'Accept-Ranges': 'bytes',
+ 'Content-Length': fileSize,
+ 'Content-Type': 'video/webm',
+ };
+ res.writeHead(200, head);
+ fs.createReadStream(path).pipe(res)
+ }
+
+});
\ No newline at end of file
diff --git a/server.js b/server.js
old mode 100644
new mode 100755
index 6dbfe13..fcb2c8a
--- a/server.js
+++ b/server.js
@@ -1,147 +1,46 @@
-const path = require('path');
-const url = require('url');
-const express = require('express');
-const fs = require('fs');
-const http = require('http');
-const io = require('socket.io');
-const app = express();
-const agent = require('agentkeepalive');
-const request = require('request');
-
-const port = 8443;
-const server = http.createServer(app).listen(port, function() {
- console.log('Open http://localhost:' + port + '/ with a browser');
-});
-
-
-// TEST PROMISE
-const readFile = (path, opts = 'utf8') =>
- new Promise((res, rej) => {
- fs.readFile(path, opts, (err, data) => {
- if (err) rej(err)
- else res(data)
- })
- })
-
-
-
-// CORS
-app.use((req, res, next) => {
- res.setHeader('Access-Control-Allow-Origin', '*');
- next();
-});
-
-app.use(express.static(path.join(__dirname, 'static')));
-
-const socket = io(server);
-
-let streamerId = '';
-let streamOnline = false;
-let req;
-
-socket.on('connection', (socket) => {
- console.log('Connected ' + socket.id);
-
- socket.on('error', (error) => {
- console.error('Connection ' + socket.id + ' error', error);
- });
-
- socket.on('disconnect',(data) => {
- if(streamerId == socket.id){
- console.log('Stream offline! ' + streamerId+ ' closed');
- } else {
- console.log('Connection ' + socket.id + ' closed');
- }
- });
-
-
- socket.on('stream', (data) => {
- streamerId = socket.id;
- streamOnline = true;
- console.log('Stream active! Session ' + streamerId);
- initConnection();
- });
-
- const onNewChunk = () => {
- new Promise((res, rej) => {
- socket.on('blob', (data) => {
- if(data){
- res(data)
- }
- else {
- rej(data);
- }
- });
- )}
- }
-
- try {
- while(true){
- req.write(await readFile('new.webm'));
- }
- } catch(ex){
- req.end();
- }
-
-});
-
-const initConnection = async () => {
- const options = {
- method: 'PUT',
- forever: true,
- uri: 'http://ws.kurento.fishrungames.com:8000/'+ streamerId + '.webm',
- headers: {
- 'Connection': 'keep-alive',
- 'content-type': 'video/webm',
- 'ice-Public': '1',
- 'ice-Name': 'Stream' + streamerId,
- 'ice-Description': 'Steam' + streamerId
- },
- auth: {
- user: 'source',
- password: 'frg$$frg'
- },
- };
-
- req = request(options, (err, message, data) => {
- if(err)
- console.log(err)
-
- //console.log(message);
- //console.log(data);
- });
-}
-
-
-app.get('/video', function(req, res) {
- const path = 'new.webm'
- const stat = fs.statSync(path)
- const fileSize = stat.size;
- const range = req.headers.range;
- if (range) {
- const parts = range.replace(/bytes=/, "").split("-");
- const start = parseInt(parts[0], 10);
- const end = parts[1]
- ? parseInt(parts[1], 10)
- : fileSize-1
- const chunksize = (end-start)+1;
- const file = fs.createReadStream(path, {start, end});
- const head = {
- 'Content-Range': `bytes ${start}-${end}/${fileSize}`,
- 'Accept-Ranges': 'bytes',
- 'Content-Length': chunksize,
- 'Content-Type': 'video/webm',
- }
- res.writeHead(206, head);
- file.pipe(res);
- } else {
- const head = {
- 'Accept-Ranges': 'bytes',
- 'Content-Length': fileSize,
- 'Content-Type': 'video/webm',
- }
- res.writeHead(200, head)
- fs.createReadStream(path).pipe(res)
- }
-
-})
\ No newline at end of file
+const path = require('path');
+const url = require('url');
+const express = require('express');
+const fs = require('fs');
+const http = require('http');
+const io = require('socket.io');
+
+const app = express();
+
+const port = 8443;
+const server = http.createServer(app).listen(port, function() {
+ console.log('Open http://localhost:' + port + '/ with a browser');
+});
+
+// CORS
+app.use((req, res, next) => {
+ res.setHeader('Access-Control-Allow-Origin', '*');
+ next();
+});
+
+app.use(express.static(path.join(__dirname, 'static')));
+
+const socket = io(server);
+
+let blobs = [];
+
+socket.on('connection', (socket) => {
+ console.log('Connected ' + socket.id);
+
+ socket.on('error', (error) => {
+ console.error('Connection ' + socket.id + ' error', error);
+ });
+
+ socket.on('disconnect',(socket) => {
+ console.log('Connection ' + socket.id + ' closed');
+ });
+
+ socket.on('blob', (data) =>{
+ console.log('new blob');
+ // Send via socket
+ //socket.broadcast.emit('newBlob', data);
+
+ // Save to file
+ fs.appendFileSync('new.webm', data);
+ });
+});