Isfaaghyth
03/29/2025, 4:40 PMsuspend fun create(
path: String,
isDebug: Boolean,
session: suspend DefaultClientWebSocketSession.() -> Unit
) {
ktorClient.config {
defaultRequest {
header("x-debug-request", isDebug)
}
}.wss(
method = HttpMethod.Get,
host = "...",
path = path,
block = session
)
}
Updated:
TIL; once the ws connection is established, we cannot change the request header. But is there any way to do so without closing and reopening the ws connection?
Thanks!Chris Lee
03/29/2025, 5:28 PMAleksei Tirman [JB]
04/02/2025, 8:03 AM