php无阻塞SSH客户端实例
之前工作中必须和国外服务器打交道,延迟和丢包问题有时候非常严重,已经到了不可忍受的地步,输入一条sql都是很费劲的事情。google搜了一遍没有找到非阻塞的ssh客户端,PHP有SSH2扩展,利用标准输入输出理论上可以实现一个基于命令的SSH客户端,这样就解决了网络问题带来的不便,于是开发了一个PHP非阻塞SSH客户端
价值:
- 基于命令,最大程度解决了网络延迟和丢包问题。
- windows和Linux下测试通过。
不足:
- 没有自动补全功能
- 没有sftp和scp等其他功能
- 没有颜色和粗体显示
- 个别情况下显示上不是很完美
- 因为现在基本不用它了,所以暂时先不进行改进。
linux 运行效果
windows下运行效果
因为是框架中的一个类,所以个别通用函数(比如debug_print())需要自己提供,我这里就不改写了
代码如下 | 复制代码 |
class FSSH{ /** function shell(){ //解决windows命令行的读取问题,没有别的办法了。 function __destruct(){ private function disconnect(){ |
demo
代码如下 | 复制代码 |
//$ssh=new FSSH(array('addr'=>'x.x.x.x:22','fp'=>array('')),'tunnel',array('pub'=>'E:Identity.pub','pri'=>'E:Identity','type'=>'ssh-rsa')); |

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Dreamweaver CS6
Visual web development tools

Zend Studio 13.0.1
Powerful PHP integrated development environment

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.