diff --git a/nestsClient/src/commonMain/kotlin/com/vitorpamplona/nestsclient/moq/lite/MoqLiteMessages.kt b/nestsClient/src/commonMain/kotlin/com/vitorpamplona/nestsclient/moq/lite/MoqLiteMessages.kt index 3d8504c1a..0ad9d08d6 100644 --- a/nestsClient/src/commonMain/kotlin/com/vitorpamplona/nestsclient/moq/lite/MoqLiteMessages.kt +++ b/nestsClient/src/commonMain/kotlin/com/vitorpamplona/nestsclient/moq/lite/MoqLiteMessages.kt @@ -21,14 +21,23 @@ package com.vitorpamplona.nestsclient.moq.lite /** - * moq-lite ALPN strings. Lite-03 is preferred; `"moql"` is the legacy - * combined ALPN that requires an in-band SETUP exchange. + * moq-lite ALPN strings. The on-the-wire framing for Subscribe / Group + * / Announce did NOT change between Lite-03 and Lite-04, so advertising + * both via `wt-available-protocols` is safe — the relay picks whichever + * it prefers and our existing codec paths handle either. We keep 03 in + * the list as the previously-tested target until the production relay's + * Lite-04 path has interop coverage. + * + * `"moql"` is the legacy combined ALPN that requires an in-band SETUP + * exchange — kept here for completeness; not advertised by the + * factory. * * Source: `kixelated/moq-rs/rs/moq-lite/src/version.rs:21-26`, * `@moq/lite/connection/connect.js:277`. */ object MoqLiteAlpn { const val LITE_03: String = "moq-lite-03" + const val LITE_04: String = "moq-lite-04" const val LEGACY: String = "moql" } diff --git a/nestsClient/src/jvmAndroid/kotlin/com/vitorpamplona/nestsclient/transport/QuicWebTransportFactory.kt b/nestsClient/src/jvmAndroid/kotlin/com/vitorpamplona/nestsclient/transport/QuicWebTransportFactory.kt index 5f24c438d..f305fc24c 100644 --- a/nestsClient/src/jvmAndroid/kotlin/com/vitorpamplona/nestsclient/transport/QuicWebTransportFactory.kt +++ b/nestsClient/src/jvmAndroid/kotlin/com/vitorpamplona/nestsclient/transport/QuicWebTransportFactory.kt @@ -20,6 +20,7 @@ */ package com.vitorpamplona.nestsclient.transport +import com.vitorpamplona.nestsclient.moq.lite.MoqLiteAlpn import com.vitorpamplona.quic.connection.QuicConnection import com.vitorpamplona.quic.connection.QuicConnectionConfig import com.vitorpamplona.quic.connection.QuicConnectionDriver @@ -89,8 +90,19 @@ class QuicWebTransportFactory( * post-CONNECT message is decoded as SETUP_CLIENT, producing * `connection closed err=invalid value` on the relay side and a stalled * subscribe / `subscribe stream FIN before reply` on the client side. + * + * `moq-lite-04` is also advertised because the production relay + * (moq.nostrnests.com) and the kixelated browser client both ship + * Lite-04 now; without it in our list a Lite-04-only deployment + * would refuse the CONNECT. The on-the-wire framing for Subscribe / + * Group / Announce did NOT change between Lite-03 and Lite-04, so + * our existing codec handles either selection. List `moq-lite-03` + * first because it's our previously-tested negotiation target — + * a relay that supports both should pick the listed-first option, + * and a Lite-04-only relay falls through to the second entry. */ - private val webTransportSubProtocols: List = listOf("moq-lite-03"), + private val webTransportSubProtocols: List = + listOf(MoqLiteAlpn.LITE_03, MoqLiteAlpn.LITE_04), ) : WebTransportFactory { override suspend fun connect( authority: String,