mirror of
https://github.com/NoCrypt/migu.git
synced 2026-04-19 23:52:06 +00:00
fix: torrentPort issues
This commit is contained in:
parent
11356d1646
commit
80447bdee9
2 changed files with 3 additions and 3 deletions
|
|
@ -25,4 +25,4 @@ async function storageQuota () {
|
|||
return quota - usage
|
||||
}
|
||||
|
||||
globalThis.client = new TorrentClient(ipcRendererWebTorrent, storageQuota, 'browser', controller)
|
||||
globalThis.client = new TorrentClient(ipcRendererWebTorrent, storageQuota, 'browser', controller, { torrentPort: Math.random() * 65535 + 1 })
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ const LARGE_FILESIZE = 32_000_000_000
|
|||
export default class TorrentClient extends WebTorrent {
|
||||
static excludedErrorMessages = ['WebSocket', 'User-Initiated Abort, reason=', 'Connection failed.']
|
||||
|
||||
constructor (ipc, storageQuota, serverMode, controller) {
|
||||
const settings = { ...defaults, ...(JSON.parse(localStorage.getItem('settings')) || {}) }
|
||||
constructor (ipc, storageQuota, serverMode, controller, settingOverrides = {}) {
|
||||
const settings = { ...defaults, ...(JSON.parse(localStorage.getItem('settings')) || {}), ...settingOverrides }
|
||||
super({
|
||||
dht: !settings.torrentDHT,
|
||||
maxConns: settings.maxConns,
|
||||
|
|
|
|||
Loading…
Reference in a new issue