silkimen / cordova-plugin-advanced-http

Cordova / Phonegap plugin for communicating with HTTP servers. Allows for SSL pinning!
MIT License
391 stars 313 forks source link

[Bug] [Android] "Error -6 No network connection available" when connected to a wifi without internet #486

Open ErwanLGZ29 opened 1 year ago

ErwanLGZ29 commented 1 year ago

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

davidanquetin commented 1 year ago

Thanks, same problem here, i will test your fork !

digaus commented 1 year ago

Same issue here when trying to communicate with smart home devices which have not internet...

silkimen commented 11 months ago

Would you please propose an option for disabling this feature and create a PR? e.g.

I would actually prefer second option but open for comments and discussion.