Does relay client transport use QUIC? #3766
-
In a previous discussion question, @thomaseizinger helped me to understand How to combine QUIC and relay client transports? #3653. I have a follow-up question: does the relay transport in the example use QUIC under the hood? Or is it using some other connection protocol? let quic_config = quic::Config::new(key_pair);
let quic_transport = quic::tokio::Transport::new(quic_config);
let (relay_transport, relay_client) = relay::client::new(key_pair.public().to_peer_id());
let relay_client = Some(relay_client);
let relay_transport = relay_transport
.upgrade(Version::V1)
.authenticate(NoiseAuthenticated::xx(key_pair).unwrap())
.multiplex(YamuxConfig::default());
let transport = OrTransport::new(quic_transport, relay_transport)
.map(|either_output, _| match either_output {
Either::Left((peer_id, muxer)) => (peer_id, StreamMuxerBox::new(muxer)),
Either::Right((peer_id, muxer)) => (peer_id, StreamMuxerBox::new(muxer)),
})
.boxed(); |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Short answer: Yes. In that code snippet, you only configured relay and QUIC. This means you can only connect to (and listen on) relays that are reachable via QUIC. Relay itself isn't a transport. A relayed connection will always run on the connection that you establish to the relay. If the relay only offers TCP+TLS+yamux and your app can only do QUIC, you won't be able to connect to the relay in the first place. Does that make sense? |
Beta Was this translation helpful? Give feedback.
-
Hi @mycognosist and @thomaseizinger, thanks for raising and answering this question. I'm also trying to understand this particular case and must admit I'm still a little confused. @thomaseizinger when you say the given example will configure a relay which is only reachable via QUIC transport, I can't find what the passed transport encryption (noise) and multiplexing (yamux) used for... Are they required for cases where we want to only offer relaying over QUIC transport? Or can they be omitted (i understand from this comment this isn't possible though)? |
Beta Was this translation helpful? Give feedback.
Short answer: Yes.
In that code snippet, you only configured relay and QUIC.
This means you can only connect to (and listen on) relays that are reachable via QUIC.
Relay itself isn't a transport. A relayed connection will always run on the connection that you establish to the relay. If the relay only offers TCP+TLS+yamux and your app can only do QUIC, you won't be able to connect to the relay in the first place.
Does that make sense?