Winston created CB-9096:
---------------------------
Summary: local-webserver plugin rejects requests after iOS app is
backgrounded
Key: CB-9096
URL: https://issues.apache.org/jira/browse/CB-9096
Project: Apache Cordova
Issue Type: Bug
Components: Labs
Affects Versions: 2.3.0, 4.0.0
Environment: iOS 4.0.0-dev, cordova-labs-local-webserver 2.3.0
Here's output platforms and plugins:
% cordova platforms
Installed platforms: ios 4.0.0-dev
Available platforms: amazon-fireos, android, blackberry10, browser, firefoxos
% cordova plugin list
com.mbppower.camerapreview 0.0.8 "CameraPreview"
com.phonegap.plugins.barcodescanner 2.2.0-ios_native "BarcodeScanner"
cordova-labs-local-webserver 2.3.0 "CordovaLocalWebServer"
cordova-labs-wkwebviewengine 0.2.0 "Cordova WKWebView Engine"
cordova-plugin-file 2.0.0 "File"
cordova-plugin-file-transfer 1.0.0 "File Transfer"
org.apache.cordova.console 0.2.13 "Console"
org.apache.cordova.plugin.ActivityIndicator 1.0.0 "Activity Indicator"
uk.co.whiteoctober.cordova.appversion 0.1.7 "AppVersion"
Reporter: Winston
I'm using the localwebserver plugin from
`https://github.com/apache/cordova-plugins/tree/master/local-webserver`. When
my iOS app goes to background and then foreground, it starts rejecting requests
for assets. I turned on logging in localwebserver and it yields these messages
in the device console:
```
May 28 16:58:58 programipadmini12 CodeStudio[314] <Warning>: GCDWebServer
started on port 51247 and reachable at http://10.1.10.30:51247/
May 28 16:59:01 programipadmini12 CodeStudio[314] <Warning>: Bonjour
registration complete for GCDWebServer
May 28 16:59:01 programipadmini12 CodeStudio[314] <Warning>: GCDWebServer now
reachable at http://programipadmini02.local:51247/
May 28 16:59:18 programipadmini12 CodeStudio[314] <Warning>: GCDWebServer
stopped
May 28 16:59:18 programipadmini12 locationd[55] <Notice>: Gesture
EnabledForTopCLient: 0, EnabledInDaemonSettings: 0
May 28 16:59:18 programipadmini12 CodeStudio[314] <Warning>: Will enter
foreground
May 28 16:59:18 programipadmini12 CodeStudio[314] <Warning>: Did open IPv4
listening socket 7
May 28 16:59:18 programipadmini12 CodeStudio[314] <Warning>: Did open IPv6
listening socket 8
May 28 16:59:18 programipadmini12 CodeStudio[314] <Warning>: GCDWebServer
started on port 51353 and reachable at http://10.1.10.30:51353/
May 28 16:59:20 programipadmini12 CodeStudio[314] <Warning>: levelName= boat2
May 28 16:59:20 programipadmini12 CodeStudio[314] <Warning>: WARN:
Phaser.Loader - image[boatlevel2screen1]: error loading asset from URL
puzzles/boat/level2-art0.png
May 28 16:59:20 programipadmini12 CodeStudio[314] <Warning>: WARN:
Phaser.Loader - image[boatlevel2screen2]: error loading asset from URL
puzzles/boat/level2-art1.png
May 28 16:59:20 programipadmini12 CodeStudio[314] <Warning>: WARN:
Phaser.Loader - image[boatlevel2screen3]: error loading asset from URL
puzzles/boat/level2-art2.png
``
You can see the webserver shuts itself down with the message `GCDWebServer
stopped` when the app goes to the background. When it is activated, you see
`GCDWebServer started on port 51353 and reachable at http://10.1.10.30:51353/`
However the game engine we are using (Phaser) is trying to load assets and they
start failing.
I'm not sure if it's significant but the webserver the first time says it's
reachable at both`http://10.1.10.30:51247/` and
`http://programipadmini02.local:51247/` but the second time it only gives the
IP address.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]