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

WebTorrent won't seed in the browser #1201

Closed
brannondorsey opened this issue Oct 5, 2017 · 5 comments
Closed

WebTorrent won't seed in the browser #1201

brannondorsey opened this issue Oct 5, 2017 · 5 comments

Comments

@brannondorsey
Copy link

@brannondorsey brannondorsey commented Oct 5, 2017

I'm using WebTorrent in the browser. Downloading from magnet URLs work great (using wss:// trackers), however I can't get any content to seed.

var client = new WebTorrent()

// When user drops files on the browser, create a new torrent and start seeding it!
DragDrop('body', function (files) {
  console.log('dragged and dropped')
  client.seed(files, function (torrent) {
    console.log('client is seeding ' + torrent.magnetURI)
    torrent.on('upload', function (bytes) {
		console.log('just uploaded: ' + bytes)
		console.log('total uploaded: ' + torrent.uploaded);
		console.log('upload speed: ' + torrent.uploadSpeed)
	})
  })
})

The client.seed(...) callback fires and a torrent magent is fired, however the content is never seeded and the upload event never gets triggered when I try to download using that magnet from another WebTorrent peer (leaving the drag-drop browser tab open of course).

I've attempted to download content from the peer using both WebTorrent desktop and another WebTorrent client in browser but to no avail.

Running webtorrent info <magnet> yields:

{
  "xt": INFO_HASH_REDACTED,
  "dn": NAME_REDACTED,
  "tr": [
    "udp://explodie.org:6969",
    "udp://tracker.coppersurfer.tk:6969",
    "udp://tracker.empire-js.us:1337",
    "udp://tracker.leechers-paradise.org:6969",
    "udp://tracker.opentrackr.org:1337",
    "wss://tracker.btorrent.xyz",
    "wss://tracker.fastcast.nz",
    "wss://tracker.openwebtorrent.com"
  ],
  "infoHash": INFO_HASH_REDACTED,
  "name": NAME_REDACTED,
  "announce": [
    "udp://explodie.org:6969",
    "udp://tracker.coppersurfer.tk:6969",
    "udp://tracker.empire-js.us:1337",
    "udp://tracker.leechers-paradise.org:6969",
    "udp://tracker.opentrackr.org:1337",
    "wss://tracker.btorrent.xyz",
    "wss://tracker.fastcast.nz",
    "wss://tracker.openwebtorrent.com"
  ],
  "urlList": []
}

I've also attempted to seed using only client.add(MAGNET_URI) (and not use an explicit call to client.seed(FILE)), but no dice.

Can anyone else out there confirm that basic seeding functionality in browser is working correctly and if so, perhaps exact code you are using. Or perhaps someone here notices an explicit error in my understanding of how WebTorrent works in the browser. Again torrent leaches fine but will not seed. I've tried many different magnets to many different files as well as different variations of the above code.

What version of WebTorrent?

Latest, delivered in the browser by CDN: https://cdn.jsdelivr.net/webtorrent/latest/webtorrent.min.js

What operating system and Node.js version?

Ubuntu 16.04

What browser and version? (if using WebTorrent in the browser)

Chormium 60.0 and Latest Firefox (not Quantum)

What did you expect to happen?

Seeding to work in browser.

What actually happened?

Torrents download but never upload using wss:// trackers.

@brannondorsey

This comment has been minimized.

Copy link
Author

@brannondorsey brannondorsey commented Oct 5, 2017

Furthermore, is client.add(...) supposed to seed the torrent automatically, or is an explicit call to client.seed(...) required to enable the uploading of a torrent?

@DiegoRBaquero

This comment has been minimized.

Copy link
Member

@DiegoRBaquero DiegoRBaquero commented Oct 5, 2017

@brannondorsey add will seed too.

@brannondorsey

This comment has been minimized.

Copy link
Author

@brannondorsey brannondorsey commented Oct 5, 2017

@DiegoRBaquero can you confirm that the seeding behavior expected from adding a torrent in one browser tab is that that browser tab should be able to seed to another browser tab that ads the same magnet?

I've been running demos using magnets of unique files that I know are not being seeded by other peers to test, and I cannot get a browser to seed to another browser. I can confirm that the above drag-drop code ^ will seed to a WebTorrent desktop client (if I copy/paste the magnet), but I've had absolutely no luck with browser-to-browser seeding.

@DiegoRBaquero

This comment has been minimized.

Copy link
Member

@DiegoRBaquero DiegoRBaquero commented Oct 5, 2017

I seem to be able to seed from btorrent.xyz to btorrent.xyz and instant.io. Also working from btorrent.xyz to WebTorrent Desktop.

Must be something related to networking/firewall

@brannondorsey

This comment has been minimized.

Copy link
Author

@brannondorsey brannondorsey commented Oct 7, 2017

This appears to have been an issue with my browser. Chromium 60 simply would not seed. Upgrading to 61 worked. Had issues on firefox as well. I figured this out because seeding wouldn't work with http://file.pizza. Switching computers and browsers worked.

@lock lock bot locked as resolved and limited conversation to collaborators May 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.