-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
noVNC /websockify
endpoint fails when web server is served with a path prefix
#1737
Comments
We explored this in #1058, but failed to find something robust. I wonder if we missed something in the reasoning there, though, as the browser is able to use relative URLs just fine. |
@CendioOssman Cheers for coming back. Ok, I see the issues from #1058. I ended up patching it for our use case as follows:
If you think, it would be too much of a hassle, feel free to close the issue. |
Fixes novnc#1737 and it should work for all of the different scenarios where the relative assets also work. This includes, for example: - / - /vnc.html - /vnc/ - /vnc/vnc.html It won't work for: - /vnc (but the assets don't work either, so it's consistent) - or /vnc.html/ (but this results in a 404 by default anyway)
if i get it right websockify fails to connect? you have to catch it at the root dir:
note that it has to be |
This won't work if you have the same server host but different users, i.e.
In this example, more than 1 user will request |
In this case i would consider using the token system. Websockify will connect the right port according to the requested token. I think if you are on the same host/same ipv4 this is the best solution. You do need just one proxypass directive in your site.conf |
Describe the bug
When noVNC is served with a path prefix, say
http://localhost:5900/pathprefix/vnc.html
, the requests to websockets fail as URL is built without considering the path prefix. In my case, I am trying to integrate noVNC within JupyterLab environment using jupyter server proxy. When running on localhost, the integrated noVNC server runs at roothttp://localhost:8888/novnc_0/
. noVNC is able to fetch all js related files by taking the/novnc_0/
prefix into account. But the endpoint/websockify
does not take the path prefix into account and hence fails. I am attaching screenshot of browser console.Looking at screenshot, the request that failed should be made to
http://localhost:8888/novnc_0/websockify
instead ofhttp://localhost:8888/websockify
.To Reproduce
A simple reproducer can be serving noVNC via a nginx reverse proxy at the path prefix.
Expected behavior
noVNC taking base URL into account while building URL for
websockify
endpoint.Screenshots
Client (please complete the following information):
Server (please complete the following information):
3553a451d8b9cf566232b7de2e764861c57a0e9a
Additional context
By taking base URL into account in
vnc.html
andvnc_lite.html
should fix the problem.The text was updated successfully, but these errors were encountered: