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

Is numPeers deprecated? #1670

Open
nimabrownlee opened this issue Jul 18, 2019 · 2 comments
Open

Is numPeers deprecated? #1670

nimabrownlee opened this issue Jul 18, 2019 · 2 comments
Labels

Comments

@nimabrownlee
Copy link

@nimabrownlee nimabrownlee commented Jul 18, 2019

What version of WebTorrent?
0.105.0
What operating system and Node.js version?
MacOS Mojave & v12.1.0
What did you expect to happen?
I am trying to check how many peers there is but numPeers doesnt exist.
What actually happened?
numPeers doesnt exist. Is the docs outdated?

@SilentBot1

This comment has been minimized.

Copy link
Member

@SilentBot1 SilentBot1 commented Jul 20, 2019

Hi @nimabrownlee

Can you provide an example of the code you are experiencing the issue with?

I'm running the following code under Windows 10 and Node v10.16.0 using WebTorrent version 0.105.0 and torrent.numPeers is working as expected.

var WebTorrent = require('webtorrent')
var Client = new WebTorrent()

var torrent = Client.add('magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F')
torrent.on('wire', (_)=>{
    console.log(`[WebTorrent-v${WebTorrent.VERSION}] [${torrent.infoHash}] Current peers: ${torrent.numPeers}`)
})

Kind regards
Brad

@feross feross added the question label Jul 20, 2019
@stale

This comment has been minimized.

Copy link

@stale stale bot commented Oct 18, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.