I have this error on iOS client and I'm not sure h...
# kotlinx-rpc
d
I have this error on iOS client and I'm not sure how to fix it:
Copy code
Error Domain=NSURLErrorDomain Code=-1011 "There was a bad response from the server." UserInfo={NSErrorFailingURLStringKey=<ws://test.com/rpc>, NSErrorFailingURLKey=<ws://test.com/rpc>, _NSURLLErrorWebSocketHandshakeFailureReasonKey=0, NSLocalizedDescription=There was a bad response from the server.}
This is my gradle build sourceSets:
Copy code
...
sourceSets {
    androidMain.dependencies {
        implementation(libs.ktor.client.cio)
        implementation(libs.kotlinx.coroutines.android)
    }
    iosMain.dependencies {
        implementation(libs.ktor.client.darwin)
    }
    commonMain.dependencies {
        implementation(projects.shared)
        ...

        implementation(libs.ktor.client.core)
        implementation(libs.ktor.client.websockets)

        implementation(libs.kotlinx.coroutines.core)
        implementation(libs.kotlinx.rpc.krpc.client)
        implementation(libs.kotlinx.rpc.krpc.serialization.json)
        implementation(libs.kotlinx.rpc.krpc.ktor.client)
    }
    ...
}
a
Hey! I'm pretty sure because test.com/rpc doesn't exist as a krpc server
d
On Android it works I just masked, the real domain is: ws://mafrend.com/rpc
@Alexander Sysoev if only it was so simple 🙂
a
Then it is a general question for #C0A974TJ9 about ws connections for your setup
d
I guess it could be because iOS client does not support websockes, okay thanks
a
No, we test on ios, it's not that
d
@Alexander Sysoev Both darwin client and cio ? I will test later today with cio, if it works then I will open an issue for the darwin client
a
Yes, only cio, as we just use ktors ws plugin. If something doesn't work on darwin - it is their bug
d
update, CIO client impl. also fails and gives:
TLS sessions are not supported on Native platform.