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 upRespect the "private" flag in .torrent files #402
Conversation
| if (self.parsedTorrent.private && self.client.dht) { | ||
| self.client.dht.destroy() | ||
| self.client.dht = null | ||
| } |
This comment has been minimized.
This comment has been minimized.
feross
Aug 19, 2015
Member
Other torrents might not be private, and we want the DHT to be available to them. Best to solve this a different way that preserves the DHT for use by other torrents.
This comment has been minimized.
This comment has been minimized.
gillesdemey
Aug 19, 2015
Author
Contributor
Oops, yeah that doesn't seem right.
Then disabling DHT for the discovery and setting DHT to false when passing the handshake options to bittorrent-protocol should suffice?
I'll take another stab at this.
This comment has been minimized.
This comment has been minimized.
|
Excellent PR! Unfortunately, lots of WebTorrent code changed recently as part of efforts to make WebTorrent and torrent-stream/peerflix share more code in common. Would you mind rebasing these changes so they merge cleanly? |
This comment has been minimized.
This comment has been minimized.
|
I'll take another look, I had noticed that |
This comment has been minimized.
This comment has been minimized.
|
Right. Instead of doing |
Add test for private torrent - should disable DHT Fail public torrent test when using a private torrent standard Disable DHT for the torrent's swarm and discovery.
cad8f91
to
0babdde
This comment has been minimized.
This comment has been minimized.
|
Rebased and updated to reflect the changes in master |
Respect the "private" flag in .torrent files
This comment has been minimized.
This comment has been minimized.
|
Nice work! Released as 0.62.0. I also added you as a GitHub collaborator. Feel free to contribute as you see fit :) |
This comment has been minimized.
This comment has been minimized.
|
Scratch that, hehe. I already added you from a previous PR |
gillesdemey commentedAug 16, 2015
Fixes #271
Couple of caveats:
bittorrent-dhtto check if the server hasn't been destroyed yet before we emit the event.