brightsign/node.js-starter-project

Trouble accessing local server on startup

Opened this issue · 1 comments

Hello and thanks for this helpful utility! I've got a node server running on a XD1034, port 9090, serving files from a directory at /storage/sd/app/public. I am able to successfully view these files from a machine on my local network at http://<player_ip_address>:9090. However, when I add an HTML widget to the XD set to display http://localhost:9090 or http://<player_ip_address>:9090, the player fails to render the page on startup. I know the server is running because I can still access the files from another machine. Meanwhile, the HTML widget shows up in my chrome://inspect devices, but the console swallows any commands I submit without executing anything.

Stranger still, if I set the player to render another site, e.g http://google.com, and then open remote dev tools for the player and run window.location = http://<player_ip_address or localhost>:9090, the HTML widget renders the local site fine. So it seems there is an issue with access the local server from an HTML widget only on startup? Is there a step missing to enable access to http://localhost:9090 as the default Site Source URL?

I found the server can take a few moments to actually start up while the HTML5 widget will visit its URL nearly instantly, so the widget attempts to render the page before the server has actually started serving requests. I worked around this by having an image displayed for 10 seconds before the HTML5 widget is displayed.