libp2p / go-libp2p-circuit

Circuit Switching for libp2p
MIT License
48 stars 16 forks source link

Better handle laddrs in Listen #28

Open Stebalien opened 6 years ago

Stebalien commented 6 years ago
  1. Listen("/p2p-circuit") should behave as it does today.
  2. Listen("/ipfs/QmOther/p2p-circuit") should dial QmOther, keep the connection open (and fail to listen if we can't dial them), and check if they support relaying.
  3. Listen should only work if: (1) we understand all the protocols in the local addr and (2) the mutliaddr ends with /p2p-circuit. Currently, we just check if it contains /p2p-circuit and accept it.
  4. We should use calls to Listen to signal that we accept relayed connections (and from where).
Stebalien commented 6 years ago

Example for point 4:

This is kind of pedantic but it allows users select which peers they want to use as relays (may be useful in cases where some links are cheaper than others).

vyzo commented 6 years ago

I think point (2) is the really important one, as it ensures we have a connection open to the relay.

Stebalien commented 5 years ago

@vyzo given that we've now enabled relay by default in go-libp2p, I'd like to fix this (at least point 3) ASAP so we can remove this dance.

Stebalien commented 5 years ago

That is, we should:

  1. Add a default listen addr of /p2p-circuit.
  2. Keep the relay enabled (for dialing) even if we run NoListenAddrs.
vyzo commented 5 years ago

That's fine by me.

raulk commented 5 years ago

@vyzo wondering if we made progress with this? I recall seeing related changes come through.

vyzo commented 5 years ago

no progress to be reported.