Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upSupport http .torrent urls in browser #208
Comments
This comment has been minimized.
This comment has been minimized.
|
http .torrent urls are not supported in the browser yet. I changed the title of this issue to reflect the real problem. Also, worth nothing that:
|
This comment has been minimized.
This comment has been minimized.
|
On second thought, I don't want to support http .torrent urls in the browser. Most .torrent files are going to be hosted on servers that don't set the correct cross-origin resource header ( If the site actually does support CORS, then you can simply fetch it yourself and pass the blob/buffer into |
This comment has been minimized.
This comment has been minimized.
|
Unless I'm misunderstanding, CORS shouldn't be an issue if you're trying to make an XHR request to load a .torrent from the current domain, which you might be doing if you were using webtorrent as part of a browser extension. |
This comment has been minimized.
This comment has been minimized.
|
@Wingman4l7 You're right. Is this an important feature to you? |
This comment has been minimized.
This comment has been minimized.
|
@feross Definitely! It's a crucial feature in using webtorrent as part of a browser extension. Of course, so is webtorrent using TCP / UDP within the browser, which is currently only does in nodejs... but that's another problem. :P |
This comment has been minimized.
This comment has been minimized.
|
Okay, PR welcome! |
I got error "Uncaught Error: invalid torrent id" with webtorrent in the browser (use webtorrent.min.js). This is my simple code:
var client = new WebTorrent();
var magnet_uri = '';
client.download(magnet_uri, function (torrent) {
console.log('Torrent info hash:', torrent.infoHash)
});
Please help me fix the error
Thanks