我应该使用什么 RPC 模块在 Python 中实现 RCP 并能够在以后更改连接方法? [英] What RPC module should I use to implement RCP in Python and be able to change connection method later?

查看:36
本文介绍了我应该使用什么 RPC 模块在 Python 中实现 RCP 并能够在以后更改连接方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我确实必须实现一些从 Python 到 Python 的 RPC,但出于安全原因,连接方法非常有限.

I do have to implement some RPC from Python to Python but the connection methods are quite limited for security reasons.

目前看来我可以使用 SSH 进行连接并在远程系统上运行单个 python 脚本.

Currently it seems that I may be able to connect using SSH and run a single python script on the remote system.

当我们可能不得不使用其他东西进行连接时,这可能会在未来发生变化,也许 telnet 所以我想要一个可以使用不同协议的解决方案.

This can change in the future when we may have to connect using something else, maybe telnet so I would like a solution that can work using different protocols.

另一个潜在的限制是关于 Python 版本,即使客户端和服务器运行不同的版本,它也必须使用 Python 2.5-2.7.

Another potential limitation is regarding Python version, it has to work with Python 2.5-2.7 even if the client and the server are running different versions.

我应该使用什么,请仅在您有成功经验的情况下提出建议,否则我也可以谷歌;)

What I should use, please suggest only if you had successful experience with it, otherwise I can google too ;)

推荐答案

我想说,在您的情况下,沟通两个不同的 Python 进程的最简单方法是使用 pyro3.我最近在一个小项目中使用了 pyro4 并且非常有效地让我专注于我想要发送/接收的信息,而不是正确编码/解码的方式.

I'd say that the easiest way to communicate two different python processes in your case is using pyro3. I've recently used pyro4 in a small project and it was very effective to let me focus in the information I wanted to send/receive rather than in the way to encode/decode it properly.

我建议您使用 v3,因为根据源代码中的 tox.ini 文件,v4 未针对 python 2.5 进行测试,因此您可能会遇到一些问题.

I recommend you to use v3 because v4 isn't tested against python 2.5 according to the tox.ini file in the sources, so you might have some problems there.

关于网络,这个库负责套接字本身,所以没有对 telnet 或 ssh 的任何明确支持(尽管使用 paramiko 在 TODO 列表中).Hene,您可能需要依赖 ssh 隧道,如本示例.

Regarding networking, this library takes care of the sockets itself, so there isn't any explicit support for telnet or ssh (although using paramiko is in the TODO list). Hene, you'll probably need to rely on ssh tunnels as in this example.

这篇关于我应该使用什么 RPC 模块在 Python 中实现 RCP 并能够在以后更改连接方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆