S.
09/29/2025, 4:43 PMIf an engine supports HTTP/2, you can enable it in the engine's configurationhow do I enable that for the Js or Okhttp client for example? I can't find any option like
protocolVersion
in the engine configAleksei Tirman [JB]
09/30/2025, 10:51 AMval client = HttpClient(OkHttp) {
engine {
preconfigured = OkHttpClient.Builder()
.protocols(listOf(Protocol.HTTP_2))
.build()
}
}
You can't configure protocols for the Js engine because the undelying implementation doesn't allow that.S.
09/30/2025, 12:20 PMS.
09/30/2025, 12:37 PMHttpClient(Darwin) {
engine {
configureSession {
setProtocolClasses(listOf(HttpProtocolVersion.HTTP_2_0))
}
}
}
is that correct for Darwin? setProtocolClasses
accepts List<*>
so not sure what it actually expectsAleksei Tirman [JB]
09/30/2025, 12:45 PMprotocolClasses
can be found here.S.
09/30/2025, 12:48 PMAleksei Tirman [JB]
09/30/2025, 1:26 PMProtocol.H2_PRIOR_KNOWLEDGE
object to avoid a round trip for the upgrade.