On Wed, Dec 28, 2022 at 8:25 PM 陈鹏鹏 <start...@gmail.com> wrote: > > Hello, > > I build a web app with guacamole-common and guacamole-common-js, everything > works fine, but I cannot find any spec or doc to tell how to use sftp in the > web app, could you please help to figure out the doc or example? Thank you.
The best example is the guacamole-client web application itself. However, it's important to note that the web client itself has no real concept of it being an "SFTP connection" - this is all taken care of by guacd, and guacd simply presents an abstracted filesystem to the web client. This allows the same code on the web client to be used for both SFTP and RDP drive redirection, and any other future file transfer mechanisms. In the guacamole-common-js code, there is a callback for handling filesystem registrations: https://github.com/apache/guacamole-client/blob/c2f2defcba73ad7ad1e5c6608a3d7b91a11313c9/guacamole-common-js/src/main/webapp/modules/Client.js#L815-L827 If you want to make a SFTP filesystem available, you'll need to implement this callback in your client. Examples of how that is done can be found in the main web client: https://github.com/apache/guacamole-client/blob/master/guacamole/src/main/frontend/src/app/client/types/ManagedClient.js https://github.com/apache/guacamole-client/blob/master/guacamole/src/main/frontend/src/app/client/controllers/clientController.js The individual components are implemented in various places in the web client: https://github.com/apache/guacamole-client/blob/master/guacamole/src/main/frontend/src/app/client/types/ManagedFilesystem.js https://github.com/apache/guacamole-client/blob/master/guacamole/src/main/frontend/src/app/client/directives/guacFileBrowser.js https://github.com/apache/guacamole-client/blob/master/guacamole/src/main/frontend/src/app/client/directives/guacFileTransfer.js https://github.com/apache/guacamole-client/blob/master/guacamole/src/main/frontend/src/app/client/directives/guacFileTransferManager.js Your implementation need not be as complex as the Guacamole Client, but you'll at least need to implement the callback and then some set of handlers to deal with file transfer events, object listings, etc. -Nick --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@guacamole.apache.org For additional commands, e-mail: user-h...@guacamole.apache.org