cordova-plugin-advanced-http
cordova-plugin-advanced-http copied to clipboard
[Bug] [Android] "Error -6 No network connection available" when connected to a wifi without internet
I am using an Redmi 10c android 12 smartphone that does not have a 4g connection. It is connected to a private wifi that doesn't have internet either and I try to make an http request on a route from a local server, the request does not work and returns an error -6, "No network connection available". The smartphone is connected to the server's wifi and the route is available.
I created a fork of this plugin by commenting the verification on 'isNetWorkAvailable' and I could communicate in http to my local server in wifi without any problem : https://github.com/ErwanLGZ29/cordova-plugin-advanced-http/blob/master/src/android/com/silkimen/cordovahttp/CordovaHttpPlugin.java
Thanks, same problem here, i will test your fork !
Same issue here when trying to communicate with smart home devices which have not internet...
Would you please propose an option for disabling this feature and create a PR? e.g.
- programmatically by API,
- or descriptively by setting a cordova plugin preference (see "AndroidBlacklistSecureSocketProtocols" as an example here: https://github.com/silkimen/cordova-plugin-advanced-http/blob/master/plugin.xml#LL11C21-L11C58)
I would actually prefer second option but open for comments and discussion.