sci-visus / OpenVisusJS

Web Viewer based on ViSUS Visualization Framework
http://www.visus.org
BSD 3-Clause "New" or "Revised" License
2 stars 5 forks source link

Default server is 'localhost' but this is unlikely to be the correct location #6

Closed cchriste closed 7 years ago

cchriste commented 7 years ago

Example: I run the server on my system at SCI and try to access the web viewer from another system. Instead, I need to enter that system's hostname, not localhost.

spetruzza commented 7 years ago

I've been thinking about this problem. I guess the solution would be to have a config file for the viewer (e.g. a config.js file) that sets the right "things" for the specific deployment. So that you can place the code everywhere you want but change the configuration on each machine. For example, if the deployment of this viewer is done through docker it should point to localhost (to the local server) by default, this is not true for other deployments. What do you think? (@cchriste @scrgiorgio)

cchriste commented 7 years ago

It's not even so nice for Docker deployments: if you run a docker on one machine but try to access its web viewer from another machine, "localhost" in this case will still refer to the client machine, not the server.

spetruzza commented 7 years ago

So the default should be the hostname of where it is deployed.

In any case would be solved with external config file.

On Sep 12, 2017, at 5:02 PM, Cameron Christensen notifications@github.com wrote:

It's not even so nice for Docker deployments: if you run a docker on one machine but try to access its web viewer from another machine, "localhost" in this case will still refer to the client machine, not the server.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub, or mute the thread.

spetruzza commented 7 years ago

Now the viewer.html includes src/config.js that contains a variable to set the URL of the server.

This can be edited for each deployment.