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

WebTorrent not working using nodejs #1668

Closed
spycorzq opened this issue Jul 8, 2019 · 7 comments
Closed

WebTorrent not working using nodejs #1668

spycorzq opened this issue Jul 8, 2019 · 7 comments

Comments

@spycorzq
Copy link

@spycorzq spycorzq commented Jul 8, 2019

What version of WebTorrent?
2.0.1 (0.104.0)

What operating system and Node.js version?
Ubuntu 16.04 os
v8.11.4 node

What browser and version? (if using WebTorrent in the browser)
Latest Chrome version downloaded from official website.

What did you expect to happen?
Seed file from nodejs

What actually happened?
I try run the code below, and I access the browser page, and I'm getting "0 peers".
But I'm able to seed on terminal using webtorrent-hybrid and this works too using webseed, but I'm failing to seed using nodejs, there are no errors.

Also, firewalls and rules is disabled by default & all ports opened.

My script:

`var WebTorrent = require('webtorrent-hybrid')
var client = new WebTorrent()

client.add('dev/webtorrent_test.torrent', function (torrent) {
console.log('Loaded')
})`

Do you know why I'm getting 0 peers after connect to the page? I spent 8 hours trying solve it by myself and nothing. Thank you.

@spycorzq

This comment has been minimized.

Copy link
Author

@spycorzq spycorzq commented Jul 8, 2019

Why do I prefer running on node instead of using on terminal, since terminal is working? Because using terminal I'm getting this error if I seed a lot of files: (node) warning: possible EventEmitter memory leak detected. 11 listeners added and my terminal freezes.

Using node, I think that is possible increase this limit of EventEmitter. If is possible increase this on terminal, please tell me! Thank you.

(I have 10gbps network speed, 64GB Ram and Intel 7)

@spycorzq

This comment has been minimized.

Copy link
Author

@spycorzq spycorzq commented Jul 8, 2019

Just to add more information: I want to seed 500 torrent files, my dedicated server is very powerful & strong. So, what is the best way to do it? I'll use webseed to improve it too, but I'm trying figure out a way to solve nodejs issue first. I'm from dev team of uploadfiles.io. Thank you, I'll wait an answer.

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Jul 11, 2019

Do you know why I'm getting 0 peers after connect to the page? I spent 8 hours trying solve it by myself and nothing. Thank you.

Did you make sure to add the same tracker servers in the browser as you did in Node.js? You can print out torrent.announce to see which tracker servers are being used. It's possible that the CLI is adding some trackers by default while the Node.js API is not adding any.

webtorrent-hybrid cannot handle seeding more than a few torrents. The WebRTC implementation that it uses under the hood is inefficient. I recommend using HTTP web seeds if you want to ensure that 100s of torrents have at least one peer always available.

Note that the message "(node) warning: possible EventEmitter memory leak detected. 11 listeners added" by itself is not a problem. It just means that more than 10 listeners were attached to the same object, which can happen if you e.g. add more than 10 torrents.

@feross feross closed this Jul 11, 2019
@spycorzq

This comment has been minimized.

Copy link
Author

@spycorzq spycorzq commented Jul 11, 2019

For example, if 100 users watch a simple mp4 video, only 200mbps will be spent on this, now, if I use webseed for 100 users watching a video, the server spend 500mbps... makes no sense! WebTorrent purpose is not designed to preserve server overloading?

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Jul 12, 2019

@spycorzq It's not clear why that would happen. If you can provide more information about what's going on, that would help.

@PaTiToMaSteR

This comment has been minimized.

Copy link

@PaTiToMaSteR PaTiToMaSteR commented Jul 13, 2019

@feross if a torrent is made with a folder should the magnet link use xs=http... encoded url to the torrent? to the mp4? both?

@spycorzq

This comment has been minimized.

Copy link
Author

@spycorzq spycorzq commented Jul 13, 2019

@feross I think that I fixed it reducing the upload speed, it's perfect now! But can you help me at this little issue? I don't know why, but WebTorrent is consuming my disk space while using webseed, sometimes I need restart the server, it seems that "temporary files" is being saved. Do you know how can I clear these without restarting the server? (edit: Linux Ubuntu Server 16.04)

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.