This repository has been archived by the owner on Aug 23, 2019. It is now read-only.
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.
This adds functionality to create private libp2p connections. A demo is also included demonstrating the interop between go and js working. I've created a WIP PR of interop tests, ipfs/interop#24. The failing tests in the PR are due to pubsub. Viewing the details you can see the private tests are functioning properly.
There is currently an issue with bad private network connections timing out instead of erroring. This is related to dominictarr/pull-reader#5. What happens is that since the private network is invalid, the stream of data coming in is still encrypted. When pull-length-prefixed attempts to determine the byte size of the incoming stream by parsing a varint, the varint is determined from encrypted data so it's wrong. When the incorrect stream size is larger than what's actually available in the buffer, it times out attempting to read what's not there.
I will continue looking into fixing the issue, but wanted to get the private network released, as it functions properly in a correct private network and the current issue doesn't pose a security risk.
Implements: https://github.com/libp2p/specs/blob/b1365bedcd46442074fbf96610f66b0663be088a/pnet/Private-Networks-PSK-V1.md