diff --git a/index.js b/index.js index 135fb93c..5f8c82a7 100644 --- a/index.js +++ b/index.js @@ -267,6 +267,7 @@ class WebTorrent extends EventEmitter { if (!opts.createdBy) opts.createdBy = `WebTorrent/${VERSION_STR}` const onTorrent = torrent => { + opts.onTorrent && opts.onTorrent(torrent) const tasks = [ cb => { // when a filesystem path is specified, files are already in the FS store