Closed neuronsupport closed 4 years ago
@norzak sounds interesting - can you explain in more detail what you mean by this? Do you mean passing in private trackers? Or a shared secret for encryption?
There is an option in web torrent API to make the seeding private so that it wont be made available to others by the trackers. This way a communication may be more secure.
@bertung ah, that's cool. Will investigate, and if you've got any links post them here.
@bertung I can't find mention of the word "private" on the API page, can you link me to what you mean?
@chr15m Interesting, according to this https://github.com/webtorrent/webtorrent/issues/386 there is a "private" option. May be the API doc is not updated? Let me check the webtorrent code.
There is private option in the code but not documented. They probably forgot to update the docs.
/**
* Create a torrent.
* @param {string|File|FileList|Buffer|Stream|Array.<string|File|Buffer|Stream>} input
* @param {Object} opts
* @param {string=} opts.name
* @param {Date=} opts.creationDate
* @param {string=} opts.comment
* @param {string=} opts.createdBy
* @param {boolean|number=} opts.private
* @param {number=} opts.pieceLength
* @param {Array.<Array.<string>>=} opts.announceList
* @param {Array.<string>=} opts.urlList
* @param {Object} opts.info
* @param {function} cb
* @return {Buffer} buffer of .torrent file data
*/
function createTorrent (input, opts, cb) {
if (typeof opts === 'function') [opts, cb] = [cb, opts]
opts = opts ? Object.assign({}, opts) : {}
_parseInput(input, opts, (err, files, singleFileTorrent) => {
if (err) return cb(err)
opts.singleFileTorrent = singleFileTorrent
onFiles(files, opts, cb)
})
}
After reviewing this I realized it isn't in the WebTorrent API documentation because it's an option that gets passed through to the underlying create torrent call. I started working on a facility to allow options to be passed through to the seed()
call too so that private
can be passed in that way. Thanks for alerting me to this.
There is a recent commit at Webtorrent side.
Working on an update.
Hey, it should be possible to pass the private
option, and other options, via torrentOpts
now. Can you guys let me know if this looks ok?
https://github.com/chr15m/bugout/blob/master/docs/API.md#options https://github.com/chr15m/bugout/blob/master/docs/API.md#private-torrents
Yes, it sounds great. thanks for this.
Perfect.
Wait, private option is not for webtorrent object it is for add and seed methods. With this change, we can add private option to seed, but not the add. Passing private to webtorrent object has no effect.
This is the add method. But add is not used by bugout. Therefore, this change solves the problem, but it is not really needed for web torrent object.
Basically you can ignore my last two comments :)
"private" option for the seeded communication path needs to be offered in constructor.