一个简单的端口分配器
portela的Python项目详细描述
波特拉
一个简单的端口分配器
Portela是一个与python2&3兼容的端口分配器,没有依赖关系。在
Portela可用于测试主机上的基本端口连接,并允许您在各种网络接口上打开端口。在
您可以使用netcat、SimpleHTTPServer、socat和其他各种工具来执行相同的功能,但是Portela更加用户友好,并且提供了一种简单的方法来绑定到各种网络接口。在
Python兼容性:2.7.x-3.8.x
平台兼容性:Linux
用法:
# portela 1234 // spin up a listener on port 1234
# portela 1234 -i eth1 // spins up on port 1234 on interface 'eth1'
# portela 1234 -i eth1 -d // spins up on port 1234 on interface 'eth1' and run as daemon
# portela 1234 -m "samba magic" // spins up on port 1234 and return a message on HTTP call
# portela stop // stops all instances of portela listerner
# portela status // check if portela is running as daemon
# portela help / -h / --help // prints this message
安装
pip安装端口
测试
本地测试
^{pr2}$守护程序
当Portela将侦听器作为后台守护程序时,它将创建一个PID文件(。波特拉.pid)在/home/user目录中
守护程序函数取自本文:https://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/
- 项目
标签: