https://kotlinlang.org logo
#ktor
Title
# ktor
l

Landry Norris

02/14/2022, 10:30 PM
I need to connect to a device directly to get data from a REST API it hosts. I’m using ktor client for this. When I am only connected to the device via wifi, I can use a base url of 10.0.0.1 and everything works fine, but when I turn on LTE, ktor gets a 404 on all the calls. I think this is because the device doesn’t provide internet, so ktor favors LTE, which does. Is there a way to configure a ktor client to ignore LTE and only communicate via wifi?
a

Aleksei Tirman [JB]

02/15/2022, 7:53 AM
I don't think you can solve this on the HTTP client's level (is it possible to do this with any other HTTP client?). Did you try port forwarding?
l

Landry Norris

02/15/2022, 2:17 PM
This needs to be set up in a production app. I don't know that port forwarding is possible in a production app. I may have to look into the network configuration on Android. I need to verify if I see the same on iOS devices.
4 Views