That was exactly what I was looking for! Yeah, I forgot to mention that I was asking this in the context of Apache Guacamole Client.
Nevertheless, thank you so much. *Krzysztof* On Sun, 30 Nov 2025 at 13:59, Nick Couchman <[email protected]> wrote: > On Sun, Nov 30, 2025 at 4:19 AM Krzysztoff <[email protected]> wrote: > > > > Hi, > > I've searched through possibly every discussion about this matter that > > exists on the Internet and so far, I haven't found the answer. > > > > Documentation for guacamole-common-js available at > > > https://guacamole.apache.org/doc/guacamole-common-js/Guacamole.WebSocketTunnel.html > > > > explicitly mentions the existence of WebSocketTunnel, however the > > exact structure and type of > > parameter tunnelURL is nowhere to be found. > > > > Lack of this knowledge is a common issue, people also mention that in > > this URL there should be a JSON token included? > > > > I believe it is not documented there because, as part of the > "guacamole-common-js" code, the exact syntax for the WebSocketTunnel > URL depends upon your implementation of a server-side component to > provide this URL, and that implementation may vary. The "common" > components of the project are meant to provide abstracts that > represent the core of the Guacamole protocol but leave the exact > implementation details undefined so that they can be easily re-used > across other projects. The full Guacamole Client has provided one > possible implementation of the common code, including things like > WebSocket tunnels. > > > > > What should a correctly formed tunnelURL parameter look like? > > If you're implementing your own Guacamole-base client/server, whatever > you want it to look like ;-). In all seriousness, for the Guacamole > Client, you can see this using the "Network" tab of the Developer > Tools in a browser when you establish a connection. Mine looks > something like this: > > wss:// > guacamole.example.com/websocket-tunnel?token=C3E8A05EAB1B0CF92D886A021965C8AE5A6817C1AFACE888D369A7496C4D6050&GUAC_DATA_SOURCE=postgresql&GUAC_ID=7&GUAC_TYPE=c&GUAC_WIDTH=1920&GUAC_HEIGHT=438&GUAC_DPI=96&GUAC_TIMEZONE=America%2FNew_York&GUAC_AUDIO=audio%2FL8&GUAC_AUDIO=audio%2FL16&GUAC_IMAGE=image%2Fjpeg&GUAC_IMAGE=image%2Fpng&GUAC_IMAGE=image%2Fwebp > > Again, this is the WebSocket URL for a full Guacamole Client > implementation, so there are several components that are specifically > implemented in that server-side code: > * token - The authentication token for the currently logged in user, > as obtained from the Guacamole REST API during login. > * GUAC_DATA_SOURCE - The data source within Guacamole that this > connection is configured in. > * GUAC_ID - The connection (or connection group) identifier within > that data source. > * GUAC_TYPE - c for connection, g for connection group. > * GUAC_WIDTH - The width of the client screen. > * GUAC_HEIGHT - The heigh of the client screen. > * GUAC_DPI - Preferred resolution DPI. > * GUAC_TIMEZONE - The timezone of the client. > * GUAC_AUDIO - Support audio formats for the client. > * GUAC_IMAGE - Supported image formats for the client. > > You can see the code that assembles this information, here: > > > https://github.com/apache/guacamole-client/blob/93f98170191a37136c931ad118ff73c644475f13/guacamole/src/main/frontend/src/app/client/types/ManagedClient.js#L307-L375 > > and you can see the code that consumes the tunnel request, here: > > > https://github.com/apache/guacamole-client/tree/main/guacamole/src/main/java/org/apache/guacamole/tunnel > > https://github.com/apache/guacamole-client/tree/main/guacamole/src/main/java/org/apache/guacamole/tunnel/TunnelRequest.java > > The code above are the specific implementations of these components > (WebSocket tunnels, URLs, parameters, etc.) that are used within the > full Guacamole Client that the project provides, and may differ if > you're trying to write your own application. > > -Nick > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
