guacamole-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cpmobile <>
Subject Statefulness of JavaScript Guacamole protocol parsers
Date Wed, 02 May 2018 11:15:33 GMT
I'm trying to integrate Guacamole's client-side JavaScript ('all.js' or
'all.min.js') with a proxy that does its own WebSocket protocol termination.

I see that sometimes, when the response stream includes a WebSocket frame
with a partial (usually long) Guacamole instruction, the parser on the
client-side aborts with an error. Modifying the proxy's code to include
complete Guacamole statements in each WebSocket frame resolves the issue but
might have serious performance implications.

Looking at the JavaScript code, I see *three* different implementations of a
Guacamole protocol parser, identified by the following identical JS comments
(present in version 0.9.14):

     // We now have enough data for the element. Parse.

Two of those implementations appear to be stateful (i.e., resilient to
receiving partial statements), while the third ('socket.onmessage') appears
not to remember the content of any previous frames/packets.

Adding 'console' logs to all three implementations reveals that the
problematic implementation is the one that takes place during normal flow.

Any idea how to fix it or make all three places use one of the stateful
implementations ?


Sent from:

View raw message