> On Apr 4, 2017, at 16:39, Bruno Savard <bsav...@zmartests.com> wrote:
> 
> Hi,
> 
> I'm adding WebSocket support to my Guacamole-driven application.
> 
> Mike suggested me to use GuacamoleWebSocketTunnelEndpoint.  For now I'm 
> creating a simple tutorial to achieve this.
> 
> My simple client (index.html) looks like this
> ...
>             // Get display div from document
>            var display = document.getElementById("display");
> 
>            // Instantiate tunnel, using a WebSocket or HTTP tunnel for 
> communications.
>            var tunnel;
>            if (window.WebSocket) {
>                // If WebSocket available, try to use it.
>                tunnel = new Guacamole.ChainedTunnel(
>                    new Guacamole.WebSocketTunnel('websocket-tunnel'),
>                    new Guacamole.HTTPTunnel('tunnel') );
>             } else {
>                // If not, then use HTTP tunnel.
>                tunnel = new Guacamole.HTTPTunnel('tunnel');
>             }
> 
>            // Instantiate client.
>            var client = new Guacamole.Client(tunnel);
> 
>            // Add client to display div
>            display.appendChild(client.getDisplay().getElement());
> 
>            // Error handler
>            client.onerror = function(error) {
>                alert(error);
>            };
> 
>            // Connect
>            client.connect();
> ...
> 
> And my GuacamoleWebSocketTunnelEndpoint implementation looks like this.  
> Which does nothing but log in Catalina.out.

This makes this issue seem like more of a configuration issue with Tomcat than 
anything else.  Can you confirm what ports Tomcat is running on?  Are you 
reverse-proxying Tomcat behind something else like Apaxhe or nginx?

> 
> public class TutorialGuacamoleWebSocketTunnelEndpoint
>    extends GuacamoleWebSocketTunnelEndpoint {
> 
>    @Override
>    protected GuacamoleTunnel createTunnel(Session session, EndpointConfig 
> config)
>            throws GuacamoleException {
> 
>        System.out.println("Using WebSocket connection.");
> 
>        // Return a new guacamole tunnel which uses the connected socket
>        return null;
>    }
> 
> }
> 
> My issue is the following.
> 
> I'm getting an WebSocket Handshare error, which could be ok because of my 
> dummy implementation, but I'm not getting any output in Catalina.out. Which 
> make me think that there is something wrong in my client.  My Implementation 
> of GuacamoleWebSocketTunnelEndpoint in not even called.
> -->  WebSocket connection to 'wss://.../tutorial/websocket-tunnel?...' 
> failed: Error during WebSocket handshake: Unexpected response code: 404

What this looks likes to me is that something like Apache httpd or nginx is 
listening on port 443 and is intercepting the wss traffic but is not configured 
to pass it on to Tomcat.

> 
> Any help will be appreciated.
> 
> Thanks,
> 
> Bruno Savard
> 

Reply via email to