command
module
Version:
v0.2.3
Opens a new window with list of versions in this module.
Published: May 21, 2023
License: Apache-2.0
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
portmap
介绍
端口映射工具,需要一个处在公网环境的服务器做流量转发
安装教程
- 安装Go环境,请参考https://golang.ir
- 在终端输入 go install gitee.com/klen-ygs/portmap@latest
使用说明
一. 生成服务端配置文件
-
打开终端输入 portmap srvconf -p srvconfig.yaml
instances:
# name是该端口映射实例的名字
- name: 服务器
# webPort是用户连接的端口
webPort: 8080
# outPort是要映射端口的主机连接服务器的端口
outPort: 1501
# password是主机连接服务器验证密码
password: klenLinux
# key是主机与服务器通信时的加密生成key,长度必须为16
key: 1234567891234567
服务端可以转发多个端口映射实例,只需在instances之后添加多个实例配置即可
- 进入srvconfig.yaml修改配置文件
二. 生成主机端配置文件
-
打开终端输入 portmap cliconf -p cliconfig.yaml
# outPort是要映射的端口
outPort: 8000
# serverEndpoint是连接服务器的地址,其中端口对应服务器的outPort
serverEndpoint: 127.0.0.1:1501
# password是主机与服务器连接验证的密码
password: klenLinux
# key是主机与服务器通信时加密使用的key,长度必须为16
key: 1234567891234567
# retry是连接服务器失败时,重试时间,单位为秒
retry: 5
- 进入cliconfig.yaml修改配置文件
三. 打开服务端软件
portmap_linux_amd64 srvrun -c srvconfig.yaml
四. 打开主机端软件
portmap_linux_amd64 clirun -c cliconfig.yaml
Documentation
¶
There is no documentation for this package.
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.