Closed renehw closed 6 months ago
I have the same problem when trying to run an app with dio in the lambdaTest tunnel
Me too, when I try to use a Flutter App on LambdaTest using a local backend over UnderPass tunnel, I face the DioExceptions "errno=7" or "errno=111", which are very generic to identify what's the main cause of the problem. One important point is that the same request that didn't run on app, works fine on Chrome present in some Real Device of LambdaTest.
Is the service running on the device? If not, use the ip of your host device to access.
Does not work with local device IP. This device is accessed remotely.
I'm not following here. Is 127.0.0.1
targeting the same device as where the Flutter app runs? Such as you are running Flutter on an Android device, but trying to access the 127.0.0.1.lambdatest
on a macOS device.
We discovered in our tests that using https://pub.dev/packages/native_dio_adapter the problem does not occur. Using native_dio_adapter, we were able to connect the remote mobile device to our QA machine without any problems.
However, despite having managed to solve this problem, I believe there is a problem when using http Dart. As native_dio_adapter uses a native library for HTTP requests, the problem does not occur. I suggest carrying out a review at this point.
For now, the problem we were having is resolved.
We cannot make any review until a detailed example is provided. I'm still not sure about the environment as I mentioned above:
I'm not following here. Is
127.0.0.1
targeting the same device as where the Flutter app runs? Such as you are running Flutter on an Android device, but trying to access the127.0.0.1.lambdatest
on a macOS device.
Package
dio
Version
5.4.1
Operating-System
Android
Output of
flutter doctor -v
Dart Version
3.3.0
Steps to Reproduce
The test form is a little complicated.
We are currently using the Lambdatest tool to perform manual tests using physical devices remotely.
To make the connection, we use a tool they provide called Underpass and in the app we use the url 'http://127.0.0.1.lambdatest:port'. The port refers to our local REST API.
Using this tool we do not obtain results, returning generic errors or timeouts.
We tested creating a native app with Kotlin using the Retrofit library for HTTP connections and we were successful.
Expected Result
A successful return is expected
Actual Result
Unhandled Dio errors or SocketException and Timeout