Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upFeature/163 global download upload limit #1040
Conversation
This comment has been minimized.
This comment has been minimized.
BenmasterTM
commented
May 15, 2017
•
|
HI, I try this changes in the webtorrent client in the webtorrent-desktop client, and when I try to set the upload/download limit for Web Torrent, this changes dont work, the only way I found to slowdown the upload files from the webtorrent client in webtorrent-desktop is changing the webtorrent/node_modules/bittorrent-protocol/index.js changing the Wire.prototype.piece function, and encapsulating the code into a timeout:
altering the timeout time change the upload speed to the web seeds, but cause many messages "start backpressure" from the simple-peer module, I know is not a fix, is only a test, but i think to limit the web seed upload/download speed is complicated due the bittorrent protocol itself... i dont know if is better/possible encapsulate the webtorrent client into some other throttle component. |
This comment has been minimized.
This comment has been minimized.
|
How did you set upload/download limits for webtorrent-desktop client?
This PR relies on https://www.npmjs.com/package/stream-throttle to throttle your bandwidth. |
This comment has been minimized.
This comment has been minimized.
BenmasterTM
commented
May 16, 2017
•
|
Yes I try that:
but the clients connected to the webtorrent client get 100% of my internet connection, i think is because im talking always about WebRTC clients (I dont test with regular uTPC clients, but in the code I see self.type === 'tcpOutgoing' and i think the web clients go for another point) Edit: I test the if
And in my log appear only 2 "NOOPE" EDIT 2: I test to remove the if and let only the self.setThrottlePipes() line.. and works, the WebPeer upload are locked to 10Kb/s... why this IF is here?? |
This comment has been minimized.
This comment has been minimized.
|
My initial use case was for TCP not WebRTC. IIRC, I encountered an edge case where you couldn't always set throttle pipes. You don't know what "tcpIncoming" are going to be use for. I would try something like so: if ((self.type === 'tcpOutgoing') || (self.type === 'webrtc')) {
self.setThrottlePipes()
} else {
conn.pipe(wire).pipe(conn)
}HTH |
This comment has been minimized.
This comment has been minimized.
BenmasterTM
commented
May 17, 2017
|
The correct value in Web Peers is self.type === 'webrtc', but works correctly, thanks! |
TwoAbove left a comment
|
Looks good! But where are the tests for the new features? I think it's a really good idea to add them |
This comment has been minimized.
This comment has been minimized.
BenmasterTM
commented
Jun 25, 2017
•
|
Hi, I found an error in specific case: If you change the upload or download speed while torrents are downloading/uploading, (with the helper function or directly in webtorrent.uploadSpeed / webtorrent.downloadSpeed), the webtorrent process crash:
|
This comment has been minimized.
This comment has been minimized.
rigelk
commented
Dec 15, 2017
|
@chtrinh do you still plan on finishing this ? |
This comment has been minimized.
This comment has been minimized.
quicoto
commented
Mar 18, 2018
|
Any updates on this? |
This comment has been minimized.
This comment has been minimized.
BenmasterTM
commented
May 6, 2018
|
Have webtorrent added some similar functionality, or we need to keep this "fix" added? |
This comment has been minimized.
This comment has been minimized.
TwoAbove
commented
May 6, 2018
|
@BenmasterTM unfortunately, no news on that, but I can confirm that this fork works |
This comment has been minimized.
This comment has been minimized.
stale
bot
commented
Aug 4, 2018
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
chtrinh commentedFeb 11, 2017
•
edited
throttleDownload() and throttleUpload() helper methods for rate adjustments
#163