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

extension support #363

Merged
merged 2 commits into from Jun 28, 2015
Merged

extension support #363

merged 2 commits into from Jun 28, 2015

Conversation

@madd512
Copy link

madd512 commented Jun 25, 2015

I made this thing support extensions. Thoughts?

Tristan Davies added 2 commits Jun 24, 2015
Tristan Davies
Tristan Davies
@feross

This comment has been minimized.

Copy link
Member

feross commented Jun 28, 2015

Yes, this is good idea. Without this, the only way to use a custom protocol extension is to send a PR to webtorrent core, or to use bittorrent-protocol directly and build your own client.

However, I'd rather emit 'wire' as an event than pass it in as an option to the WebTorrent constructor, because we currently don't have any on* style options – those are all events. I'll make this change to your PR.

Eventually, we might want to add an extensions option to the constructor to make it easier than:

var MyExtension = require('./my-extension')

torrent.on('wire', function (wire) {
  wire.use(MyExtension)
})
@feross

This comment has been minimized.

Copy link
Member

feross commented Jun 28, 2015

Released as 0.50.0.

@feross feross merged commit a71f9a1 into webtorrent:master Jun 28, 2015
1 check failed
1 check failed
continuous-integration/travis-ci/pr The Travis CI build failed
Details
feross added a commit that referenced this pull request Jun 28, 2015
@madd512

This comment has been minimized.

Copy link
Author

madd512 commented Jun 29, 2015

👍

I wasn't super happy with the onWire option. I was thinking maybe client.use(Extension) but this works too.

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

Successfully merging this pull request may close these issues.

None yet

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