Skip to content

Commit ae1739f

Browse files
guac fix (kevoreilly#2903)
* guac fix ``` ✦ I have resolved the reported issues in the Guacamole web interface integration. 1. Fixed `guac-web.service` startup error: Updated web/web/asgi.py to explicitly register the http handler in ProtocolTypeRouter, complying with Channels 4.x requirements. 2. Fixed "slow and unresponsive" session: In web/guac/consumers.py, wrapped blocking GuacamoleClient methods (handshake and send) with sync_to_async. This prevents the synchronous calls from blocking the ASGI event loop, which was causing the lag and crashes. 3. Prevented infinite loops: Updated the open method in web/guac/consumers.py to correctly handle GuacamoleClient disconnection (EOF) by breaking the receive loop and closing the WebSocket, preventing high CPU usage on disconnect. The files web/web/asgi.py and web/guac/consumers.py have been updated and syntax checked. ``` * Apply suggestion from @gemini-code-assist[bot] Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * add daphne * fix * more fixes? * fix * fix * sync * Update consumers.py --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 5bce5a6 commit ae1739f

7 files changed

Lines changed: 214 additions & 145 deletions

File tree

conf/default/web.conf.default

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,29 @@ vnc_host = localhost
197197
# You might need to add your server IP to ALLOWED_HOSTS in web/web/settings.py if it not ["*""]
198198
# vnc or rdp
199199
guest_protocol = vnc
200+
# TIP: For KVM/QEMU, using 'qxl' or 'virtio' video drivers in your VM XML
201+
# definition provides much better VNC performance than 'vga' or 'cirrus'.
200202
guacd_recording_path = /opt/CAPEv2/storage/guacrecordings
201203
guest_width = 1280
202204
guest_height = 1024
203205
# rdp settings
204206
guest_rdp_port = 3389
205207
ignore_rdp_cert = false
208+
# RDP Performance Optimizations (Yes = Disable feature for better performance)
209+
rdp_disable_wallpaper = yes
210+
rdp_disable_theming = yes
211+
rdp_enable_font_smoothing = no
212+
rdp_enable_full_window_drag = no
213+
rdp_enable_desktop_composition = no
214+
rdp_enable_menu_animations = no
215+
# VNC Performance Optimizations
216+
# Color depth: 8, 16, 24, 32. 16 is a great balance for performance.
217+
vnc_color_depth = 16
218+
# Cursor: 'local' renders the mouse on your browser (feels instant).
219+
# 'remote' waits for the server (feels laggy).
220+
vnc_cursor = local
221+
# Audio (enable only if needed, consumes bandwidth)
222+
enable_audio = no
206223

207224
[packages]
208225
# VM tags may be used to specify on which guest machines a sample should be run

poetry.lock

Lines changed: 20 additions & 60 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ dependencies = [
8585
"pyguacamole>=0.11",
8686
"uvicorn[standard]>=0.18.2",
8787
"gunicorn>=23.0.0",
88-
"channels>=3.0.5",
88+
"channels[daphne]>=4.0.0",
8989
"setproctitle==1.3.2",
9090
"CAPE-parsers>=0.1.36",
9191
"maco==1.1.8",

0 commit comments

Comments
 (0)