简体   繁体   English

带有浏览器的ssh2模块

[英]ssh2 module with browserify

I'm using this code here to transfer a file from my computer to a remote server, using the ssh2 module in node. 我在这里使用此代码 ,使用node中的ssh2模块将文件从计算机传输到远程服务器。 It works perfectly when I use node directly for the job but I want to transfer the file from my browser using SSH. 当我直接使用节点执行任务,但是我想使用SSH从浏览器传输文件时,它可以完美工作。

I was thinking I could use browserify for the job. 我当时想我可以使用browserify来完成这项工作。 My idea was that a user presses a button in the browser and the bundle.js script tag activates the above linked module, allowing the user selected file to be transferred to the server. 我的想法是,用户按下浏览器中的按钮,bundle.js脚本标签将激活上述链接的模块,从而使用户选择的文件可以传输到服务器。

Any ideas on how this can be done? 关于如何做到这一点的任何想法?

The main problem as far as I know with trying to use something like ssh2 with browserify is that the crypto in browserify is lacking still. 据我所知,尝试在浏览器中使用ssh2之类的主要问题是,浏览器中的加密仍然缺乏。 Also the other big problem is that there is no shim/polyfill for plain TCP sockets in the browser (for now). 另外,另一个大问题是浏览器中(目前)没有用于普通TCP套接字的填充/填充。 I did see a project where someone had a client/server thing for browserify to emulate TCP sockets, but it doesn't look like it's maintained anymore. 我确实看到了一个项目,在该项目中,有人使用客户机/服务器来进行browserify来模拟TCP套接字,但是看起来好像不再维护它了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM