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

can not download in node.js #1587

Closed
cellargalaxy opened this issue Feb 27, 2019 · 4 comments
Closed

can not download in node.js #1587

cellargalaxy opened this issue Feb 27, 2019 · 4 comments
Labels

Comments

@cellargalaxy
Copy link

@cellargalaxy cellargalaxy commented Feb 27, 2019

What version of WebTorrent?
webtorrent@0.103.0
What operating system and Node.js version?
ubuntu16.04 , node v10.4.1
What browser and version? (if using WebTorrent in the browser)
Google Chrome 72.0.3626.119
What did you expect to happen?
nodo.js can seed to browser.
What actually happened?
In my pc, I seed a file in browser(instant.io) and download torrent from browser. It is success downloading in webtorrent desktop. Browser upload file to webtorrent desktop. But it is fail downloading in node.js. Node.js always not link to browser or webtorrent desktop.

bt.js

var WebTorrent = require('webtorrent')

var client = new WebTorrent()

client.add('/home/xxx/xxx.torrent', function (torrent) {
    torrent.on('wire', function (wire, addr) {
        console.log('connected to peer with address ' + addr)
    })
    setInterval(function () {
        console.log('Progress: ' + (torrent.progress * 100).toFixed(1) + '%')
        console.log('numPeers: ' + torrent.numPeers)
        console.log('uploadSpeed: ' + torrent.uploadSpeed)
        console.log('uploadSpeed: ' + torrent.uploadSpeed)
    }, 5000)
})

execute node bt.js, print:

Progress: 0.0%
numPeers: 0
uploadSpeed: 0
uploadSpeed: 0
Progress: 0.0%
numPeers: 0
uploadSpeed: 0
uploadSpeed: 0
......

What i do wrong? I am learning javascript. Or can give me some example about this?
thanks

@Novalis15

This comment has been minimized.

Copy link

@Novalis15 Novalis15 commented Mar 31, 2019

Hey there, i have the same issue with the latest version. I tested out a few versions of webtorrent to see when was the final version that webtorrent worked with node. For me webtorrent@0.101.0 is the last version that works, so i guess webtorrent is somehow broken since webtorrent@0.101.1 I recommend trying a rollback to webtorrent@0.101.0 and see if that works. :)

misc for devs

client.add(...) still triggers the callback function which also passes the torrent object, however it seems like it won't get modified / downloaded anymore (Chrome debugger helped me out with this).

@MeowTheCat

This comment has been minimized.

Copy link

@MeowTheCat MeowTheCat commented May 29, 2019

I had the same issue while building webtorrent-desktop with webtorrent as dependency. Even I roll back to 0.101.0 as Killuah15 mentioned, magnetic link still doesn't work (.torrent file would work)

@stale

This comment has been minimized.

Copy link

@stale stale bot commented Aug 27, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Aug 27, 2019
@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Sep 4, 2019

I'm confused by this issue. Are you expecting the webtorrent package in node.js to connect with peers in web browsers? This is not possible. You need to use webtorrent-hybrid in node.js instead, if you want to connect to browsers.

If this isn't what you meant, then please leave a comment.

@feross feross closed this Sep 4, 2019
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
4 participants
You can’t perform that action at this time.