fix: use rtcConfig for file transfers

This commit is contained in:
Jeremy Kahn 2023-02-22 09:48:51 -06:00
parent 1f1e112ec1
commit 99a9ab7838
3 changed files with 14 additions and 8 deletions

14
package-lock.json generated
View File

@ -39,7 +39,7 @@
"readable-web-to-node-stream": "^3.0.2", "readable-web-to-node-stream": "^3.0.2",
"remark-gfm": "^3.0.1", "remark-gfm": "^3.0.1",
"sass": "^1.54.3", "sass": "^1.54.3",
"secure-file-transfer": "^0.0.4", "secure-file-transfer": "^0.0.7",
"streamsaver": "^2.0.6", "streamsaver": "^2.0.6",
"trystero": "github:jeremyckahn/trystero#bugfix/29__clean-up-peers", "trystero": "github:jeremyckahn/trystero#bugfix/29__clean-up-peers",
"typeface-public-sans": "^1.1.13", "typeface-public-sans": "^1.1.13",
@ -23282,9 +23282,9 @@
} }
}, },
"node_modules/secure-file-transfer": { "node_modules/secure-file-transfer": {
"version": "0.0.4", "version": "0.0.7",
"resolved": "https://registry.npmjs.org/secure-file-transfer/-/secure-file-transfer-0.0.4.tgz", "resolved": "https://registry.npmjs.org/secure-file-transfer/-/secure-file-transfer-0.0.7.tgz",
"integrity": "sha512-oqxgXA4YdrRZkOb5GNEXSOagMbLs6AKYoVWonBLL/dIxjR3KRC49P3rf6xOLXVzIvxr947PlXN6yol44ZfVo0Q==", "integrity": "sha512-E4jxuZci0KSxdHEcH9006BYHKRfsBNP1PSdsM/3b1BLDPxoRvqj1RZN+dHJ4lJ42Pd7YzBDIOEXrzmBG5rHAOg==",
"dependencies": { "dependencies": {
"@types/streamsaver": "^2.0.1", "@types/streamsaver": "^2.0.1",
"@types/webtorrent": "^0.109.3", "@types/webtorrent": "^0.109.3",
@ -43748,9 +43748,9 @@
} }
}, },
"secure-file-transfer": { "secure-file-transfer": {
"version": "0.0.4", "version": "0.0.7",
"resolved": "https://registry.npmjs.org/secure-file-transfer/-/secure-file-transfer-0.0.4.tgz", "resolved": "https://registry.npmjs.org/secure-file-transfer/-/secure-file-transfer-0.0.7.tgz",
"integrity": "sha512-oqxgXA4YdrRZkOb5GNEXSOagMbLs6AKYoVWonBLL/dIxjR3KRC49P3rf6xOLXVzIvxr947PlXN6yol44ZfVo0Q==", "integrity": "sha512-E4jxuZci0KSxdHEcH9006BYHKRfsBNP1PSdsM/3b1BLDPxoRvqj1RZN+dHJ4lJ42Pd7YzBDIOEXrzmBG5rHAOg==",
"requires": { "requires": {
"@types/streamsaver": "^2.0.1", "@types/streamsaver": "^2.0.1",
"@types/webtorrent": "^0.109.3", "@types/webtorrent": "^0.109.3",

View File

@ -35,7 +35,7 @@
"readable-web-to-node-stream": "^3.0.2", "readable-web-to-node-stream": "^3.0.2",
"remark-gfm": "^3.0.1", "remark-gfm": "^3.0.1",
"sass": "^1.54.3", "sass": "^1.54.3",
"secure-file-transfer": "^0.0.4", "secure-file-transfer": "^0.0.7",
"streamsaver": "^2.0.6", "streamsaver": "^2.0.6",
"trystero": "github:jeremyckahn/trystero#bugfix/29__clean-up-peers", "trystero": "github:jeremyckahn/trystero#bugfix/29__clean-up-peers",
"typeface-public-sans": "^1.1.13", "typeface-public-sans": "^1.1.13",

View File

@ -2,6 +2,7 @@ import { FileTransfer, setStreamSaverMitm } from 'secure-file-transfer'
import { trackerUrls } from 'config/trackerUrls' import { trackerUrls } from 'config/trackerUrls'
import { streamSaverUrl } from 'config/streamSaverUrl' import { streamSaverUrl } from 'config/streamSaverUrl'
import { rtcConfig } from 'config/rtcConfig'
setStreamSaverMitm(streamSaverUrl) setStreamSaverMitm(streamSaverUrl)
@ -9,4 +10,9 @@ export const fileTransfer = new FileTransfer({
torrentOpts: { torrentOpts: {
announce: trackerUrls, announce: trackerUrls,
}, },
webtorrentInstanceOpts: {
tracker: {
rtcConfig,
},
},
}) })