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

bittorrent-swarm methods #695

Closed
Wasser-Eis opened this issue Mar 25, 2016 · 3 comments
Closed

bittorrent-swarm methods #695

Wasser-Eis opened this issue Mar 25, 2016 · 3 comments

Comments

@Wasser-Eis
Copy link

@Wasser-Eis Wasser-Eis commented Mar 25, 2016

swarm.on('wire', function(wire) {
// a relevant wire has appeared, see bittorrent-protocol for more info
wire.on('unchoke', function() {
// we are now unchoked
})
swarm.wires // <- list of all connected wires
});

Do swarm and wire instances offer other methods?
Are there other undocumented functions in the WebTorrent API?
Can I manually choke a peer?
Which of these functions can only be used in node.js and which ones can be used in the browser?

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Apr 1, 2016

Yes, there are methods on the swarm and wire objects. The methods are undocumented because they should probably not be used on most cases, but you're free to try.

The wire methods are documented here: https://github.com/feross/bittorrent-protocol

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Apr 1, 2016

Some methods like wire.use are intended to be used by end users, though.

You can manually choke a peer with wire.choke().

@feross feross closed this Apr 1, 2016
@lock

This comment has been minimized.

Copy link

@lock lock bot commented May 4, 2018

This thread has been automatically locked because it has not had recent activity. To discuss futher, please open a new issue.

@lock lock bot locked as resolved and limited conversation to collaborators May 4, 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
2 participants
You can’t perform that action at this time.