Skip to content

Conversation

@meln5674
Copy link

@meln5674 meln5674 commented Aug 5, 2025

The default path for the websocket endpoint is not treated as relative path, despite all other urls in the application being treated as relative. This means that when running the application at a proxied subpath, (e.g. /foo/bar/baz/ is rewritten to just / by the proxy and sent to the application) the default websocket path is still just websockify, and not foo/bar/baz/websockify. This forces users to make a manual advanced settings change on each new environment.

This patch remedies this by checking the current path, appending websockify (including a slash between, if necessary), then trimming the leading slash. This produces a default path that is correct both when serving from / as well as a subpath, with or without a trailing /.

I did not find any docs on how to run or write unit tests, but I am happy to add some if desired.

Instead of hardcoding default path to "websockify", determine the
subpath the app is running at by inspecting the current window location,
and default to "<subpath>/websockify" instead. Trim the leading and
trailing slashes to ensure that the path is well-formed.
@meln5674 meln5674 changed the title Fix default path when running at a subpath Fix default websocket path when running at a subpath Aug 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant