I'm trying to embed Guacamole into my webapp. My backend is Node.js and I
don't want to write my own backend tunnel, so I'm trying to proxy requests
from my Node.js server to the guacamole Apache server.

my client (guacamole-common-js loaded in Chrome) => my server (Node.js) =>
guacamole (docker image) => guacd (docker image)

So my server is making a request to

http://localhost:8080/guacamole/api/tokens

and then connecting to

ws://localhost:8080/guacamole/websocket-tunnel?token=my-tokenGUAC_DATA_SOURCE=mysql&...

guacamole accepts the connection:

13:14:05.472 [http-nio-8080-exec-4] INFO  o.a.g.tunnel.TunnelRequestService
- User "my-user" connected to connection "1".
13:14:05.482 [http-nio-8080-exec-4] INFO  o.a.g.tunnel.TunnelRequestService
- User "my-user" disconnected from connection "1".

and guacd establishes the ssh connection

guacd[35]: INFO:        SSH connection successful.
guacd[35]: INFO:        User "@my-id" disconnected (0 users remain)

but as you can see, the connection is immediately closed by the client.

guacamole-common-js is closing the connection immediately and throwing this
error:

WebSocket connection to 'ws://my-computer:8080/my-path' failed: Invalid
frame header

The headers returned by the upgrade request look good:

Connection:Upgrade
Sec-WebSocket-Accept:/my-code
Sec-WebSocket-Extensions:permessage-deflate; client_max_window_bits=15
Sec-WebSocket-Protocol:guacamole
Upgrade:websocket

There isn't much info in the Chrome debugger WS tab. There is only one
frame:

(Opcode -1) 20 08:14:05.580

Does anyone know why the handshake may fail when proxied?

I'm using https://github.com/nodejitsu/node-http-proxy to proxy the
websocket. From the unit tests, it appears to support large frames and
multiple frames. It closes the socket before any data is sent by guacd.

-Andrew Johnston



--
Sent from: http://apache-guacamole-incubating-users.2363388.n4.nabble.com/

Reply via email to