钉钉提供的内网穿透工具
https://github.com/mzlogin/ding-tunnel
内网穿透示意图
使用方法
HTTP 穿透
1.下载工具
git clone https://github.com/open-dingtalk/pierced.git
cd windows_64
chmod +x ding
运行一下两种都可以使用
ding -config ding.cfg -subdomain ashun 3000
ding -config=ding.cfg -subdomain=ashun 3000
# 如运行失败
# ./ding -config=ding.cfg -subdomain=ashun 3000
前台运行
ding -config=ding.cfg -log=stdout -log-level=INFO -proto=http -subdomain=ashun 3000
命令解释:
项目解释
ding
程序位置
-config=ding.cfg
配置文件位置
-log=stdout
日志格式为stdout
-log-level=INFO
日志级别为INFO
-proto=http
仅用http
-subdomain=ashun 8082
二级域名为ashun 本地端口为3000
自定义域名
从ngrok服务器请求自定义主机名。(仅HTTP)(需要DNS的CNAME)
域名要备案哦
-hostname string
-hostname=ashun.tk
自定义,自己的域名方法
ding -config=ding.cfg -proto=http -hostname=ashun.ga -subdomain=ashun 3000
命令解释:
项目解释
ding
程序位置
-config=ding.cfg
配置文件位置
-proto=http
仅用http
-hostname=ashun.tk
自定义域名【域名要备案】
-subdomain=ashun 3000
二级域名为ashun 本地端口为3000
后台运行
nohup ding -config=ding.cfg -log=stdout -log-level=INFO -proto=http -hostname=ashun.ga -subdomain=ashun 3000 > catalina.out 2>&1 &
命令解释:
项目解释
nohup
表示后台运行
> catalina.out 2>&1 &
把日志实时的输出到 catalina.out文件
钉钉后台运行实例:
nohup ding -config=ding.cfg -log=stdout -log-level=INFO -proto=http -subdomain=servername 172.8.8.8:8080 > haha.out 2>&1 &
命令翻译
Options:
-authtoken string 用于标识ngrok.com帐户的身份验证令牌
-config string ngrok配置文件的路径。 (默认值: $HOME/.ngrok)
-hostname string 从ngrok服务器请求自定义主机名。(仅HTTP)(需要DNS的CNAME)
-httpauth string username:password 公共隧道端点的HTTP基本身份验证
-logstring 将日志消息写入此文件. 'stdout' and 'none' 具有特殊含义(默认为"none")
-log-level string 字符串要记录的消息级别。下列之一:DEBUG,INFO,WARNING,ERROR(默认为" DEBUG")
-proto string 隧道{'http','https','tcp'}上的流量协议(默认值:'http + https')(默认值" http + https")
-subdomain string 从ngrok服务器请求自定义子域。(仅HTTP)
“浩然”“浩轩”“梓轩”满大街?青岛爸妈为啥取这些名字…澳洲坚果的10大健康与营养益处