Osman Saral
04/12/2023, 9:30 AMMockEngine
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?ayodele
04/12/2023, 9:35 AMOsman Saral
04/12/2023, 12:02 PM