k4kfh / ZephyrCab

Drive a model train with prototypical controls, realistic behavior, and simulated physics; uses JMRI's WebSockets interface for layout connection
http://k4kfh.github.io/ZephyrCab
GNU Affero General Public License v3.0
10 stars 4 forks source link

Automatic connection when running on JMRI web server #22

Closed k4kfh closed 7 years ago

k4kfh commented 7 years ago

If ZephyrCab is run on the JMRI web server, it should automatically connect to the railroad. The best way to do this seems to be having an option in settings.json that automatically connects to the server it's running on. This should be turned on by default, making it easy to install on JMRI, but still possible to run on an external web server for development purposes.

k4kfh commented 7 years ago

This should be implemented in the master branch now; I just committed the feature. I tested it on a couple JMRI installs.

ZephyrCab will assume it's running on JMRI's internal Jetty web server unless told otherwise in settings.json. It uses location.hostname and location.port in the browser to automatically connect to your JMRI server based on that assumption. If you want to use an external web server, you can see the comments in settings.json. I plan on updating the documentation later, and I won't close this issue until I do.

k4kfh commented 7 years ago

I've updated the docs with good information on this feature, and created a new, easier installation guide with this feature in mind. I tested this feature on two machines and had no issues.