floatinghotpot / cordova-httpd

Embed tiny web server into Cordova with a plugin
285 stars 148 forks source link

Reports ip of 0.0.0.0 when iOS in Airplane Mode #39

Open trenthm opened 8 years ago

trenthm commented 8 years ago

Using WKWebView on iOS 9.2.1, if Airplane Mode is turned on, httpd.startServer() success callback passes an ip of "0.0.0.0" to the function, even though it's actually running on 127.0.0.1.

So to use it right now, I'm doing something like this:

httpd.startServer({
    'www_root': wwwroot,
    'port': 8080
}, function (url) {
    url = url.replace("0.0.0.0", "127.0.0.1"); // Airplane mode correction
    console.log("server is started: " + url);
}