Hi All,

We want to access vm console by using noVNC and Rest api. We are using websocket proxy on the same machine where engine runs and we try to get the console access from the another server that is outside from this cluster. 
 
But when we try to connect the vnc_auto.html from the server using host ip, port and the password which we get from the ticket creation… it shows a Failed to connect to server (code: 1006).
 
The following are the codes which we use to create the ticket… host,port and the password will get from the ticket and with the same details (host,port & password) we are able to connect the console using the vnc clients(TigerVNC etc.) 
 
try {
                var host = WebUtil.getQueryVar('host', '<?php echo $host?>');
                var port = WebUtil.getQueryVar('port', '<?php echo $port?>');
  var path = WebUtil.getQueryVar('path', 'websockify');
                
  var password = '<?php echo $password?>';
 
        if ((!host) || (!port)) {
                    updateState('failed',
                        "Must specify host and port in URL");
                    return;
                }
 
                rfb = new RFB({'target':       $D('noVNC_canvas'),
                           'encrypt':      WebUtil.getQueryVar('encrypt',
                                   (window.location.protocol === "https:")),
                           'true_color':   WebUtil.getQueryVar('true_color', true),
                           'local_cursor': WebUtil.getQueryVar('cursor', true),
                           'shared':       WebUtil.getQueryVar('shared', true),
                           'view_only':    WebUtil.getQueryVar('view_only', false),
                           'updateState':  updateState,
                           'onPasswordRequired':  passwordRequired});
                           rfb.connect(host, port, password, path);
            }catch(e) {alert(e);
 
 
Could you please check if there any issues with it and guide me how to get rid of this failed to connect error?
 
I have attached the screen shots for further reference…

-- 
Regards
Shanil