-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use relative path for websocket #3
Comments
Doesn't this assume that the web client is running at |
Good observation, that's true. Summary:
In the first situation, the web client is aware of the fact that it is serving a page from a subdirectory of the web client and could adjust the websocket URL. It's difficult for me to estimate the consequences in this project. :) Are there web clients that use the history API? |
I don't know, there is quite a few clients and I haven't looked closely at any of them. If there isn't, it still something I'd really like clients to do so back/forward etc works properly, so I don't want to do anything that makes it harder on clients using the History API. |
Some thoughts:
Personally, I was surprised how difficult it is to let mopidy run in a subdirectory. For example, the musicbox_webclient has hard-coded absolute URLs all over the place and isn't usable at all since you can't configure it. Moped did a much better job – only the websocket URL was preventing it from running out of the box. |
Hey, sorry for the thread-necromancy, but I see this still hasn't been resolved. I'm trying to set up a system with multiple mopidy-instances/streams running at the same time, I was able to trick Iris into supporting similar enough by setting the port to something like "80/ch02" which hopefully won't be patched out later with |
If the mopidy server is mounted in a subdirectory via a reverse proxy (e.g.,
https://domain/mydir
, such that apps are available underhttps://domain/mydir/app
), then the default websocket url in https://github.com/mopidy/mopidy.js/blob/master/src/mopidy.js#L65 points to the wrong location. Since the code already uses browserify (yey!), a solution is to use url.resolve() in order to determine the path:and then
In my setup, mopidy is mounted in a subdirectory via nginx and it took me a while to figure out why moped wasn't able to connect to the websocket. The above change would make it work without any further configuration.
What do you think?
The text was updated successfully, but these errors were encountered: