guacamole-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From messido <mohammad.zba...@gmail.com>
Subject Guacamole only shows a screenshot when using importState
Date Fri, 15 Sep 2017 20:47:56 GMT
To cut it short, I'm using my own front end. One of my pages create the
connection with guacamole, and when connection is established it uses
"exportState" to save the state inside localStorage as a JSON string..
So far so good, I get valid data.

Now when I go to a different page and importState from local storage (after
JSON parsing) I get almost like a snapshot of the host machine, I can see it
but cant interact with anything.. pretty sure it's just a still image
because the terminal cursor isn't flashing.. anyways here's my code 

@ViewChild('display') display: ElementRef;
   guac: any  = new Guacamole.Client(new Guacamole.HTTPTunnel('tunnel'));

    constructor(....) {};

    ngAfterContentInit() {
       
this.display.nativeElement.appendChild(this.guac.getDisplay().getElement());
        this.guac.importState(JSON.parse(localStorage.getItem('guacState')),
() => {
            console.log('done importing state');
        });
        // Mouse
        const mouse = new
Guacamole.Mouse(this.guac.getDisplay().getElement());

        mouse.onmousedown =
            mouse.onmouseup   =
                mouse.onmousemove = (mouseState) => {
                    this.guac.sendMouseState(mouseState);
                };

        // Keyboard
        const keyboard = new Guacamole.Keyboard(document);

        keyboard.onkeydown = (keysym) => {
            this.guac.sendKeyEvent(1, keysym);
        };

        keyboard.onkeyup = (keysym) => {
            this.guac.sendKeyEvent(0, keysym);

        };
        this.guac.onerror = error => {
          alert(error);
        };
    }

Am I using the wrong functionality? Are importState and exportState meant to
be like just a snapshot of that current moment? I'm looking for a way  to
save the clients.. state... so i can move it around and start that same
session from different computers




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

Mime
View raw message