feat(nests): advertise both moq-lite-03 and moq-lite-04 ALPNs

Production moq-relay (moq.nostrnests.com) and the kixelated browser
client both ship Lite-04 now. We previously only advertised
moq-lite-03 in the wt-available-protocols header, so a Lite-04-only
relay deployment would refuse the WebTransport CONNECT (no mutual
sub-protocol).

Add moq-lite-04 to the advertised list. The on-the-wire framing for
Subscribe / Group / Announce did NOT change between Lite-03 and
Lite-04, so the existing codec handles either selection unchanged —
this is purely a handshake-layer addition. moq-lite-03 stays listed
first so a relay that supports both still picks the previously-tested
path.

Constants now live on MoqLiteAlpn alongside LITE_03 and LEGACY rather
than being a string literal in QuicWebTransportFactory.

https://claude.ai/code/session_014JfZJHSTvyYYWJbC9VbB47
This commit is contained in:
Claude
2026-05-06 15:27:21 +00:00
parent 361dbbe201
commit 4b736263e0
2 changed files with 24 additions and 3 deletions
@@ -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"
}
@@ -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<String> = listOf("moq-lite-03"),
private val webTransportSubProtocols: List<String> =
listOf(MoqLiteAlpn.LITE_03, MoqLiteAlpn.LITE_04),
) : WebTransportFactory {
override suspend fun connect(
authority: String,