Skip to content
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

Hardcoded websocket path when using noVNC full version #440

Closed
wongsyrone opened this issue May 26, 2021 · 10 comments
Closed

Hardcoded websocket path when using noVNC full version #440

wongsyrone opened this issue May 26, 2021 · 10 comments

Comments

@wongsyrone
Copy link

I have to change ws_path everytime when I want to use noVNC full variant.

Hardcoded here:

<label for="noVNC_setting_path">Path:</label>
<input id="noVNC_setting_path" type="text" value="websockify">

The lite version works because:

//const path = readQueryVariable('path', 'websockify');
const path = readQueryVariable('path', '{{ ws_path }}');

get data from:

ws_path = WS_PUBLIC_PATH if WS_PUBLIC_PATH else "/"
if ":" in ws_host:
ws_host = re.sub(":[0-9]+", "", ws_host)
if console_type == "vnc" or console_type == "spice":
console_page = "console-" + console_type + "-" + view_type + ".html"
response = render(request, console_page, locals())
else:
if console_type is None:
console_error = _("Fail to get console. Please check the console configuration of your VM.")
else:
console_error = _("Console type '%(type)s' has not support") % {"type": console_type}
response = render(request, "console-vnc-lite.html", locals())

@wongsyrone
Copy link
Author

The issue is caused by 43f1461

@wongsyrone
Copy link
Author

@catborise @retspen The template got removed from the commit above. Is it intentional?

@catborise
Copy link
Collaborator

I dont think it is intentional change, may be it is missed. We could change it, if it is useful.

@wongsyrone
Copy link
Author

I think it's useful as it's more convenient.

@wongsyrone
Copy link
Author

@catborise Any update on this?

@catborise
Copy link
Collaborator

@wongsyrone it is initiated at different place. changing "websockify" does not affect. i think it is set in UI.js which is not reach ws_path value.

@wongsyrone
Copy link
Author

@catborise

Nope. I fixed it on my side by reverting partial changes (console-vnc-full.html) of 43f1461

@catborise
Copy link
Collaborator

@wongsyrone i change it. but i cannot test it(my test shows no effect). if it is working fine...

@wongsyrone
Copy link
Author

24cd3f7 looks good to me.

@MisterBlueBear
Copy link
Contributor

I don't think this fix works at all. If I view the HTML source, I do see the correct HTML code, but in the console settings, it is still set to "websockify".

May I suggest just adding the location conf for "websockify" to /etc/nginx/conf.d/webvirtcloud.conf as a workaround. This fixes the issue.

    location /websockify {
        proxy_pass http://wssocketiod;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }

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

No branches or pull requests

3 participants