ec-node: moq-rs draft-07 for Cloudflare relay
This commit is contained in:
parent
ce8c1319f4
commit
09246513ab
6 changed files with 36 additions and 47 deletions
|
|
@ -4229,26 +4229,29 @@ async fn wt_publish(args: WtPublishArgs) -> Result<()> {
|
|||
let relay_url = Url::parse(&args.url)
|
||||
.with_context(|| format!("invalid relay url: {}", args.url))?;
|
||||
|
||||
// Cloudflare's relay currently implements a subset of the IETF MoQ Transport draft-07.
|
||||
// Use moq-transport (via moq-native-ietf) for interoperability.
|
||||
// Cloudflare's public relay currently implements a subset of the IETF MoQ Transport draft-07.
|
||||
// The upstream (newer-draft) moq stack does not interop; use the draft-07 compatibility
|
||||
// implementation from the moq-rs repository.
|
||||
let mut tls_args = moq_native_ietf::tls::Args::default();
|
||||
tls_args.disable_verify = args.tls_disable_verify;
|
||||
let tls = tls_args.load().context("failed to load TLS config")?;
|
||||
|
||||
let bind: std::net::SocketAddr = "[::]:0".parse().expect("valid bind addr");
|
||||
let quic = moq_native_ietf::quic::Endpoint::new(moq_native_ietf::quic::Config::new(
|
||||
bind, None, tls,
|
||||
))
|
||||
let quic = moq_native_ietf::quic::Endpoint::new(moq_native_ietf::quic::Config {
|
||||
bind: "[::]:0".parse().expect("valid bind addr"),
|
||||
tls,
|
||||
})
|
||||
.context("failed to init moq-native-ietf endpoint")?;
|
||||
|
||||
let namespace = moq_transport::coding::TrackNamespace::from_utf8_path(&args.name);
|
||||
let (writer, _, reader) = moq_transport::serve::Tracks::new(namespace).produce();
|
||||
let (writer, _, reader) = moq_transport::serve::Tracks::new(
|
||||
moq_transport::coding::Tuple::from_utf8_path(&args.name),
|
||||
)
|
||||
.produce();
|
||||
let mut media = moq_pub::Media::new(writer).context("failed to init moq-pub media parser")?;
|
||||
|
||||
tracing::info!(url=%relay_url, name=%args.name, "connecting to relay");
|
||||
let (session, _cid) = quic
|
||||
let session = quic
|
||||
.client
|
||||
.connect(&relay_url, None)
|
||||
.connect(&relay_url)
|
||||
.await
|
||||
.context("failed to connect to relay")?;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue