Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option `port` is required on Electron. #1783

Open
xland opened this issue Nov 28, 2019 · 0 comments
Open

Option `port` is required on Electron. #1783

xland opened this issue Nov 28, 2019 · 0 comments

Comments

@xland
Copy link

@xland xland commented Nov 28, 2019

Electron 7.1.2 and 6.1.4
Windows 10

Code:

    var WebTorrent = require("webtorrent");
    if (WebTorrent.WEBRTC_SUPPORT) {
      console.log(1);
    } else {
      console.log(2);
    }
    var client = new WebTorrent();
    var torrentId =
      "magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fsintel.torrent";
    client.add(torrentId, function(torrent) {
      var file = torrent.files.find(function(file) {
        return file.name.endsWith(".mp4");
      });
      file.appendTo(".home");
    });

Error:

index.js?17f3:13 Uncaught Error: Option port is required
at new Discovery (index.js?17f3:13)
at Torrent._startDiscovery (torrent.js?c115:317)
at Torrent._onListening (torrent.js?c115:288)
at Torrent._onParsedTorrent (torrent.js?c115:244)
at eval (torrent.js?c115:205)
at processTicksAndRejections (internal/process/task_queues.js:75)

I try these code in the browser. It is ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.