portmap

command module
v0.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

README

portmap

介绍

端口映射工具,需要一个处在公网环境的服务器做流量转发

安装教程
  1. 安装Go环境,请参考https://go.dev
  2. 在终端输入 go install gitee.com/klen-ygs/portmap@latest

使用说明

一. 生成服务端配置文件
  1. 打开终端输入 portmap srvconf -p srvconfig.yaml

    instances:
        # name是该端口映射实例的名字
      - name: 服务器
        # webPort是用户连接的端口
        webPort: 8080
        # outPort是要映射端口的主机连接服务器的端口
        outPort: 1501
        # password是主机连接服务器验证密码
        password: klenLinux
        # key是主机与服务器通信时的加密生成key,长度必须为16
        key: 1234567891234567
    

    服务端可以转发多个端口映射实例,只需在instances之后添加多个实例配置即可

  1. 进入srvconfig.yaml修改配置文件
二. 生成主机端配置文件
  1. 打开终端输入 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
    
  1. 进入cliconfig.yaml修改配置文件
三. 打开服务端软件
portmap_linux_amd64 srvrun -c srvconfig.yaml
四. 打开主机端软件
portmap_linux_amd64 clirun -c cliconfig.yaml

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL