Hi Everyone, I'm trying to run Web Socket client t...
# multiplatform
o
Hi Everyone, I'm trying to run Web Socket client tests on iOS. Since ktor's
MockEngine
doesn't support Web Sockets, I setup a
TestServerPlugin
like ktor did in their repo. This way a websocket server starts on the localhost, and client can connect to the server and run the tests. This works perfectly with Android. But on iOS I get the error below. I think iOS simulator cannot connect to the localhost.
io.ktor.client.engine.darwin.DarwinHttpRequestException: Exception in http request: Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={NSErrorFailingURLStringKey=<ws://127.0.0.1:8080/websocket>, NSLocalizedDescription=Could not connect to the server., NSErrorFailingURLKey=<ws://127.0.0.1:8080/websocket>}
Can anyone help me with this?
a
Can you link the setup you used??