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.io VS instant.io #1300

Closed
Ciao121 opened this issue Feb 18, 2018 · 3 comments
Closed

webtorrent.io VS instant.io #1300

Ciao121 opened this issue Feb 18, 2018 · 3 comments

Comments

@Ciao121
Copy link

@Ciao121 Ciao121 commented Feb 18, 2018

Hi,
I'm trying to understand why, using MS EDGE, the torrent located at https://webtorrent.io/torrents/sintel.torrent is playing on webtorrent.io but not on instant.io.
Can anybdy help to understand? Thank you!

@SilentBot1

This comment has been minimized.

Copy link
Member

@SilentBot1 SilentBot1 commented Feb 19, 2018

Hey Ciao121,

When on webtorrnet.io, the .torrent file is embedded in the page (bundle.js@76) as a base64 encoded buffer and the torrents content is loaded from 'https://webtorrent.io/torrents/' via HTTP(s) without using any WebRTC, hence only the single peer listed on the graph. As mentioned in #1291 WebRTC data channels support is missing in Edge.

If you use the torrent listed at 'https://webtorrent.io/torrents/sintel.torrent' in Edge, as the .torrent file contains the necessary metadata and webseed url it should also load the content over HTTP(s) and it should load fine within Edge, if you are using the .torrent within Edge and it isn't working, go into the development console (F12), enable logging by entering localStorage.debug = '*', reload the page, re-add the .torrent file and reply with the full console output after leaving it to run for a few minutes (depending on your connection speed).

If you use the MagnetURI within Edge on Instant.io without specifying torrent.xs when adding the torrent, it will rely on using a WebSocket tracker to try and find a peer with the metadata, which won't work due to the lack of data channels mentioned above.

In environments where web sockets can't be used, when adding a torrent to the client via infohash, you can manually specify a HTTP(s) url to load the .torrent file (metadata) from and the HTTP(s) location of the torrents content. An example of this is as follows:

var torrent = client.add('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')
torrent.xs = 'https://webtorrent.io/torrents/sintel.torrent'
//Adding the webseed here is redundant as the magneturi already includes it, but in a case where the magneturi doesn't include the webseed url, you can specify it manually like so.
torrent.addWebSeed("https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F")
torrent.on('metadata', ()=>{
  console.log('Metadata loaded via HTTP(s)')
  var file = torrent.files.find(function (file) {
    return file.name.endsWith('.mp4')
  })
  file.appendTo('body')
})

The example above should work on Instant.io in Edge if pasted within the development console (F12) using solely HTTP(s).

@Ciao121

This comment has been minimized.

Copy link
Author

@Ciao121 Ciao121 commented Feb 19, 2018

@SilentBot1
Thank you very much for the detailed technical answer. It's really technical and I have to make test as you explained to fully understand it. But right now bot webtorrent.io and instant.io are down (and I cannot get the torrent file) https://www.site24x7.com/public/t/results-1519045310188.html :(

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Feb 20, 2018

There was some brief ~1hr downtime this morning due to emergency maintenance at the webhost.

Seems like this issue is resolved. Thanks for the detailed answer, @SilentBot1. I'm going to close this now, but feel free to continue discussion in this issue.

@feross feross closed this Feb 20, 2018
@lock lock bot locked as resolved and limited conversation to collaborators May 25, 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
3 participants
You can’t perform that action at this time.