你的位置:首页 > 互联网IT
python-port-forward端口转发,TCP端口映射,TCP端口转发,python
支持系统:Windows/Linux
软件名称:python-port-forward
软件下载:python-port-forward-master.rar
python环境下载Windows64位:python-2.7.18.amd64.rar
python官网:https://www.python.org/downloads/
python环境linux:百度搜索:python linux安装 (centos7.3/7.6大部分系统自带python环境)
http://c.biancheng.net/view/4162.html
https://jingyan.baidu.com/article/64d05a021ccca9de55f73bf8.html
项目地址:https://github.com/zhopen/python-port-forward
评测:TCP转发速度可以,支持Windows/Linux,不支持udp,缺点是不能同时多个运行,比较繁琐,主要是负载小
Windows用法:
第一步:
安装:python环境
第二步:
编辑目录下:port-forward.config
(支持域名与IP)
域名方法:
本地端口 远程服务器(域名或者IP) 远程端口
3000 www.012.ooo 3001
# 10020 x.x.x.x 10040
第三步:
port-forward.py与port-forward.config与.gitignore在同目录下
运行:port-forward.py
端口转发成功
多个端口转发,复制目录,编辑配置文件port-forward.config,运行port-forward.py即可
linux用法:
第一步:首先,我们来查看一下Python 有没有已经安装好了,运行“yum list installed | grep python”或“rqm -qa|grep python”命令。如果可以查询到结果,则表明已经安装好,否则表示尚未安装。或直接运行“python”命令,没报错则已经安装。
有就不用安装,没有就安装python环境
python环境linux:百度搜索:python linux安装 (centos7.3/7.6大部分系统自带python环境)
http://c.biancheng.net/view/4162.html
https://jingyan.baidu.com/article/64d05a021ccca9de55f73bf8.html
第二步:
编辑目录下:port-forward.config
(支持域名与IP)
域名方法:
本地端口 远程服务器(域名或者IP) 远程端口
3000 www.012.ooo 3001
# 10020 x.x.x.x 10040
第三步:
上传文件到/root夹
/root/python-port-forward-master
port-forward.py与port-forward.config与.gitignore在同目录下
# cd /root/python-port-forward-master/
运行(前台运行)
# sudo python port-forward.py
运行(隐藏后台运行)
# nohup sudo python port-forward.py >/dev/null 2>&1 &
结束运行
# killall -I python
出现不能关闭(CentOS killall出现-bash: killall: command not found及使用方法)
https://www.zhuguodong.com/?id=541
项目原文:
Python Port Forward
This script forwards a number of configured local ports to local or remote socket servers.
Usage:
git clone git@github.com:vinodpandey/python-port-forward.git cd python-port-forward # update port-forward.config file # default port forward is localhost:80 > localhost:8080 (80 localhost 8080) sudo python port-forward.py # with default port-forward.config, access: http://localhost/ -> this should now show content from http://localhost:8080/ # you can run a test python http server using below command to check the default configuration # python -m SimpleHTTPServer 8080
Configuration:
Add to the config file port-forward.config lines with contents as follows: <local incoming port> <dest hostname> <dest port> Note: Don't insert any blank line bewteen two lines.
Starting/stopping
Start the application at command line with 'sudo python port-forward.py' and stop the application by keying in <ctrl-c>.
Errors
Error messages are stored in file 'error.log'.
发表评论: