你的位置:首页 > 互联网IT

dockward端口转发端口映射支持Windows/Linux中转服务

系统:Windows/Linux


下载地址Windows/linux:dockward端口转发映射


点评:单个运行速度,可以支持域名与IP地址


项目地址:https://github.com/abiosoft/dockward

项目下载地址:https://github.com/abiosoft/dockward/releases


Windows使用说明:

              程序 -host 本地端口 远程IP或者域名:端口

/dockward_windows_amd64.exe --host 8080 127.0.0.1:3000 127.0.0.1:3001


端口转发开始.bat

start "" "dockward_windows_amd64.exe" --host 2310 114.114.114.114:2300

start "" "dockward_windows_amd64.exe" --host 2311 200.kanguge.com:2301


QQ截图20200505024942.jpg dockward端口转发端口映射支持Windows/Linux中转服务 互联网IT



Linux使用说明:


下载:

curl -LO https://github.com/abiosoft/dockward/releases/download/0.0.4/dockward_linux_amd64.tar.gz

备用下载地址:

curl -LO https://www.zhuguodong.com/xiazai/dockward_linux_amd64.tar.gz


解压:

tar xvfz dockward_linux_amd64.tar.gz

执行:

sudo mv dockward_linux_amd64 /usr/local/bin/dockward

权限

sudo chmod +x /usr/local/bin/dockward

前台运行:

ip模式

方法一:dockward --host 8080 127.0.0.1:3000 127.0.0.1:3001
方法二:dockward --host 8080 127.0.0.1:3000

域名模式

方法一:dockward --host 8080 www.baidu.com:3000 www.qq.com:3001
方法二:dockward --host 8080 www.baidu.com:3000


后台运行:

方法:nohup dockward --host 8080 www.baidu.com:3000 >/dev/null 2>&1 &


停止dockward

# killall -I dockward



#查看转发

netstat -tanulp


查看端口转发PID:410


结束程序,其中410则为此转发的pid,杀掉命令为

kill -9 410

停止dockward

killall -I dockward



查看运行程序用法:

# top



---------------------------------------------------------------------------------------

原文:

Typical Dockward use cases include:

  • Port forwarding to containers without published ports.

  • Port forwarding to containers based on a filter.

  • Testing stateless app scaled via docker-compose.

Requirements

Docker 1.10 and docker deamon running.

Installation

Homebrew (OSX only)

brew install dockward

Binary

Download binary for other platforms on the releases page or replace download link accordingly for OSX.

curl -LO https://github.com/abiosoft/dockward/releases/download/0.0.4/dockward_linux_amd64.tar.gz \&& tar xvfz dockward_linux_amd64.tar.gz \&& sudo mv dockward_linux_amd64 /usr/local/bin/dockward \&& sudo chmod +x /usr/local/bin/dockward

Source

Requires Go.

go get -v -u github.com/abiosoft/dockward

Usage

Note: If dockward is not running on Linux or docker host, you will access it via docker host ip (e.g. dockermachine ip). Except --hostmode.

Forward port 8080 to port 8080 in container amazing_leavitt.

dockward 8080 name=amazing_levitt

Forward port 8080 to port 80 in containers with label type=nginx.

dockward 8080 80 label=type=nginx

Forward port 8080 to a local port 3000.

dockward --host 8080 3000

Forward port 8080 to endpoints 127.0.0.1:3000 and 127.0.0.1:3001.

dockward --host 8080 127.0.0.1:3000 127.0.0.1:3001

For more.

dockward --help

Limitations

  • Dockward is intended for simple local development use cases. It may work for you outside of that.

  • Docker networks created are default settings i.e. bridge/overlay as the case may be. Nothing special.

Why the name ?

Naming is hard, you know.

DockerForward, port forwarding tool for docker containers.

License

Apache 2


  • 发表评论
  • 查看评论
【暂无评论!】

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。