Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
k-rpc-socket | k-rpc | bittorrent-dht | torrent-discovery | webtorrent
This is one of many pull requests across the WebTorrent ecosystem to add IPv6 DHT support, as per #88
Per the BEP 32 statement about maintaining distinct IPv4/IPv6 DHTs and the discussion on #88, my implementation requires separate instances of
bittorrent-dht
and everything below it on the protocol stack (k-rpc
andk-rpc-socket
).torrent-discovery
maintains up to twoDHT
instances, one for each IP version used. Fortunately, WebTorrent already supports IPv6 peers, so no changes are needed in it beyond properly using the IPv6 DHT, if enabled in the options.The best way to run all of my changes is by using the npm link command. Assuming that all of the necessary modules (
k-rpc-socket
,k-rpc
,bittorrent-dht
,torrent-discovery
,webtorrent
, andwebtorrent-cli
are sibling directories, the following commands will set things up properly (starting from the parent directory):From there, you can test and run individual modules as you choose.
bittorrent-dht specific notes:
This repository has comparatively few changes - most of them are just wrapping the tests to use both
IPv4
andIPv6
DHTs. I make use of the_encodeIP
function that I add ink-rpc
to write out the encoded form of an IPv4 or IPv6 address.Notes:
values
lists. i.e. ones which contain a mixture ofIPv4
andIPv6
addresses. However, I treat them as a non-fatal error condition, since they aren't supposed to be sent.ubuntu-16.10-desktop-amd64.iso
andubuntu-16.10-server-amd64.iso
, since the other torrents don't have any IPv6 DHT nodes available. As Ubuntu is a fairly popular Linux distribution, there should always be at least some nodes in the DHT serving it.