ActionScript 3 and SSH
Is there a library for SSH in ActionScript 3? If not, I'd appreciate some ideas on how to have Flash integrate with SSH.
I have a Flash prototype programmed out, and my client wants to see some minimal integration with an SSH server. What is needed is basically:
- connect
- authenticate
- send a few basic commands
I can't just have these commands be sent out blin开发者_开发知识库dly, as I need Flash to be aware of the SSH feedback and let the user know if the authentication, commands, etc were successful.
I don't believe that there is any SSH client implementation for AS3. Do you really need it to be SSH or just some protected protocol? Flash can pretty easily read https - so if you just need it to be encrypted you could use https to send/receive your data.
Otherwise you'd probably have to port the OpenSSH client to AS3 - not an easy task -- and the client site would still need to have a flash policy file to allow a flash client to open the SSH port (22?)
Actually, if you're using Adobe AIR you have a pretty clean solution.
Using Adobe AIR's NativeProcess feature, you can launch an SSH client from AS3 and communicate with it. putty.exe is a great and simple ssh client but does not work from command-line on its own. fortunately, plink.exe which is kind of an add-on software that works with putty (downloadable on the same page), allows putty.exe to be launched and used from classic command-line (thus by NativeProcess).
This way, you just have to download putty.exe and plink.exe, put them in the bin folder of your application (so it works autonomously), and launch a NativeProcess from your AIR/AS3 program.
Simple and clean.
Hope that helps, even if the original thread is pretty old :)
精彩评论