roerohan / react-vnc

A React Component to connect to a websockified VNC client using noVNC.
https://roerohan.github.io/react-vnc/
MIT License
88 stars 21 forks source link

How to disconnect a session ? #18

Closed dorroddorrod closed 2 years ago

dorroddorrod commented 2 years ago

Hi, How can i disconnect a session from a noVNC client ? I noticed when i'm not disconnecting and move to other page in my application and then trying to reconnect again its getting stuck cause the session is still there.

github-actions[bot] commented 2 years ago

:tada: This issue has been resolved in version 0.2.9 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

roerohan commented 2 years ago

Thanks for raising this issue @dorroddorrod !

I've recently added v0.2.9 You can use a ref (such as the following) to access the connect() and disconnect() methods. https://github.com/roerohan/react-vnc/blob/f7b77d88a0a36d3e01f7853b6bce316822281d75/src/App.tsx#L8

Here's a sample of how to use the ref. https://github.com/roerohan/react-vnc/blob/f7b77d88a0a36d3e01f7853b6bce316822281d75/src/App.tsx#L40-L53

roerohan commented 2 years ago

In #28 , I've also added support for the following methods from RFB

sendCredentials,
sendKey,
sendCtrlAltDel,
focus,
blur,
machineShutdown,
machineReboot,
machineReset,
clipboardPaste