From 99a9ab783815e3bddeebd0de8ad74d010e5162b1 Mon Sep 17 00:00:00 2001 From: Jeremy Kahn Date: Wed, 22 Feb 2023 09:48:51 -0600 Subject: [PATCH] fix: use rtcConfig for file transfers --- package-lock.json | 14 +++++++------- package.json | 2 +- src/services/FileTransfer/FileTransfer.ts | 6 ++++++ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index c7e18d2..4d9c083 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,7 +39,7 @@ "readable-web-to-node-stream": "^3.0.2", "remark-gfm": "^3.0.1", "sass": "^1.54.3", - "secure-file-transfer": "^0.0.4", + "secure-file-transfer": "^0.0.7", "streamsaver": "^2.0.6", "trystero": "github:jeremyckahn/trystero#bugfix/29__clean-up-peers", "typeface-public-sans": "^1.1.13", @@ -23282,9 +23282,9 @@ } }, "node_modules/secure-file-transfer": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/secure-file-transfer/-/secure-file-transfer-0.0.4.tgz", - "integrity": "sha512-oqxgXA4YdrRZkOb5GNEXSOagMbLs6AKYoVWonBLL/dIxjR3KRC49P3rf6xOLXVzIvxr947PlXN6yol44ZfVo0Q==", + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/secure-file-transfer/-/secure-file-transfer-0.0.7.tgz", + "integrity": "sha512-E4jxuZci0KSxdHEcH9006BYHKRfsBNP1PSdsM/3b1BLDPxoRvqj1RZN+dHJ4lJ42Pd7YzBDIOEXrzmBG5rHAOg==", "dependencies": { "@types/streamsaver": "^2.0.1", "@types/webtorrent": "^0.109.3", @@ -43748,9 +43748,9 @@ } }, "secure-file-transfer": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/secure-file-transfer/-/secure-file-transfer-0.0.4.tgz", - "integrity": "sha512-oqxgXA4YdrRZkOb5GNEXSOagMbLs6AKYoVWonBLL/dIxjR3KRC49P3rf6xOLXVzIvxr947PlXN6yol44ZfVo0Q==", + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/secure-file-transfer/-/secure-file-transfer-0.0.7.tgz", + "integrity": "sha512-E4jxuZci0KSxdHEcH9006BYHKRfsBNP1PSdsM/3b1BLDPxoRvqj1RZN+dHJ4lJ42Pd7YzBDIOEXrzmBG5rHAOg==", "requires": { "@types/streamsaver": "^2.0.1", "@types/webtorrent": "^0.109.3", diff --git a/package.json b/package.json index 9d94bcb..d08fe58 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "readable-web-to-node-stream": "^3.0.2", "remark-gfm": "^3.0.1", "sass": "^1.54.3", - "secure-file-transfer": "^0.0.4", + "secure-file-transfer": "^0.0.7", "streamsaver": "^2.0.6", "trystero": "github:jeremyckahn/trystero#bugfix/29__clean-up-peers", "typeface-public-sans": "^1.1.13", diff --git a/src/services/FileTransfer/FileTransfer.ts b/src/services/FileTransfer/FileTransfer.ts index dcd899b..723a3d3 100644 --- a/src/services/FileTransfer/FileTransfer.ts +++ b/src/services/FileTransfer/FileTransfer.ts @@ -2,6 +2,7 @@ import { FileTransfer, setStreamSaverMitm } from 'secure-file-transfer' import { trackerUrls } from 'config/trackerUrls' import { streamSaverUrl } from 'config/streamSaverUrl' +import { rtcConfig } from 'config/rtcConfig' setStreamSaverMitm(streamSaverUrl) @@ -9,4 +10,9 @@ export const fileTransfer = new FileTransfer({ torrentOpts: { announce: trackerUrls, }, + webtorrentInstanceOpts: { + tracker: { + rtcConfig, + }, + }, })