This repository has been archived by the owner on Aug 23, 2019. It is now read-only.
Feat/expose connection handling flow in dial #216
Closed
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.
@diasdavid @dignifiedquire
I need the ability to pass a raw connection to the swarm and have it encrypted and muxed, this is required for onion dialing, since when I get a conn from one relay to another relay, I have no way to upgrade that with encryption and muxing (handshake).
Here is a typical flow:
/ipfs/QmRealy1/p2p-circuit/ipfs/QmRelay2/p2p-circuit/ipfs/QmDest
/ipfs/QmRealy1/
and hand it the/ipfs/QmRelay2
address as a destrelay1 <=> relay2
circuit exists, but since it hasn't been returned to the swarm it has not gone through muxing and encryption. Next time I read from that connection, I get a multristream header sent from QmRelay2 that is the start of the regularp2p
handshake, for therelay1 <=> relay2
connection.Exposing the the dial/handshake flow would allow me to manually send the
relay1 <=> relay2
to the swarm and have it go through the handshake. The other option would be to reimplement the handshake in circuit, but I don't think we want to do that :)