I'm willing to create a HttpClient(CIO), but CIO i...
# multiplatform
m
I'm willing to create a HttpClient(CIO), but CIO is not found/accessible Although the package io.ktor.http.cio and CIOHeaders is well visible 😕
k
we had an issue with CIO on Android. had to use one of the Android engines.
i don't recall what it was off the top of my head, but it had been reported and was still open
👍 1
in terms of your specific problem, do you have the proper dependencies for common as well as each target?
m
I have absolutely no clue if I do. I'm just starting with it 😕 implementation("io.ktorktor client cio$ktor_version") I have this dependency set for all three of them - commonMain, androidMain and iosMain From what I got it should be requiring no dependencies and I didn't find specific android/iOS versions of library (https://ktor.io/clients/http-client/engines.html)
Did You successfully use Android engine for WebSockets? I can't find it now, but I ve seen on Kotlin or Ktor website, that only CIO is working with websocket
k
never used WebSockets
however, the artifact name is different per platform
m
Got it: https://ktor.io/clients/websockets.html#artifact-15 (doesn't list Android/iOs as valid engines) https://amryousef.me/android-ktor (Explicit note it's only for CIO)
m
ah, ok, sure. How can one find artifact names tho? I don't think I ve seen ios/android versions of CIO on maven neither
there is only one engine for iOS
m
Yes, and it's not CIO 😛
k
so your take away today, CIO is broken on android and not available on iOS 😛
m
Thus websockets are impossible to use in multiplatform... That's what I thought 😕 Shame
k
Ktor provides a WebSocket client for the following engines: CIO, OkHttp, Js
m
But thanks for Your replies! Appreciate it! 🎉
đŸ» 1
k
so you can use OkHttp on Android
m
OkHttp - Android, sure but what about iOS?
k
SOL
m
there's just no way yet to implement it, aye?
k
not that I can see
m
Okay, so we got that settled : ) Great, thanks! 👏