Node.js: Hooking repl to a remote node server

为君一笑 提交于 2019-12-06 00:34:10

问题


Let's say I have a node server running at mysite.com. Is there a way to set up that server so that I can use node's repl api to securely connect to it from my local machine?


回答1:


Well, if you used this example:

net.createServer(function (socket) {
  repl.start("node via TCP socket> ", socket);
}).listen(5001, "localhost");

And firewalled that port 5001, you should be able to securely connect to it using ssh:

ssh user@host nc localhost 5001

In this case, the security relies on your firewall, and ssh.



来源:https://stackoverflow.com/questions/9302458/node-js-hooking-repl-to-a-remote-node-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!