想在外网访问你机器上的demo? ngrok估计是最好的选择
但ngrok早已经被墙, 原因你懂的
so, Nutz社区提供一个ngrok服务, 供各位nutz使用者享用
当然, 无可避免的有一点限制条件:
- 使用Github登陆
- Nutz的使用者 -- 当然,我不能校验这个,靠自觉吧
- 不可以部署非法应用, 大流量应用
准备好了吗? 访问下来地址吧
@vincentwong109 y,写错说明了,哈哈
@wendal @vincentwong109 成功了吗?
@wendal 成功了,谢谢兽总!
附上ngrok服务器端的代码, 在原版基础上增加
@gitleonine1989 待会我发个网盘地址吧
http://pan.baidu.com/s/1eQptxvk 客户端网盘地址
@wendal +1024赞
@wendal 成了。不太懂网络,这是叫端口映射么
@gitleonine1989 不是, 端口映射一般指同一个网络内的行为(路由器-->局域网机器)
这东西跟我大学时候写的一个概念,当时放弃了...
@wendal 我是半路出家的猿基础不扎实啊。看到文档里提到隧道协议这个名词,想起vpn来了。兽总大学时一定是学霸,鉴定完毕。
已经显示online了,那已经是成功了
来自炫酷的 NutzCN
自己的digitalocean还有2个月,我也搭建了个.
你们试试能用不?
http://pan.baidu.com/s/1jH1TBaI
@wendal 这个福利还在么?
@shevawen 一直开着
@wendal 哦,需要登录,thx
@fangjingping 每个人的审美不一样导致的,哈哈
@crskyp 点"配置文件"
@wendal 可是登陆我只在社区nutz.cn登陆了下啊,然后下载合格命令执行了下就完成了,这个他还会自动去扫描我登陆社区没有吗
@wendal 终于反应过了,那个下载配置文件里面的token 是根据登陆信息动态生成的吧。 反应慢了点。
"linux包", 那是ngork本身, 怎么可能带ngrok.yml, 就算有,也不是nutz.cn提供的版本
http://nutz.cn/ngrok/me 里面的"配置文件" 才是下载ngork.yml的链接.
server_addr: wendal.cn:4443
trust_host_root_certs: true
auth_token: q3p3lj6duojdrqu9pi603o63g3
tunnels:
httpbin:
proto: http
addr: 80
sshbin:
proto: tcp
addr: 22
./ngrok -config ngrok.yml start httpbin
Tunnel httpbin does not specify any protocols to tunnel.
help why?
@zingers 没有意义。nutz.cn提供的ngrok服务,每个帐号只能映射一个固定域名的http隧道。
@wendal ngrok 停了? 一直 Tunnel Status : reconnecting
@shevawen 你网络的问题...
现已全面支持https访问!!! 全面支持微信小程序的https/wss协议的要求.
直接换成https即可访问
https://wendal.ngrok.wendal.cn/nutzbook/yvr/list
真金白银的付费https泛域名证书, 非自签名证书, 没有https证书警告!!!
@wendal 为什么我的启动后就只有一个http的地址,没有https呢?
ngrok
Tunnel Status online
Version 1.7/1.7
Forwarding http://xxxx.ngrok.wendal.cn:9080 -> 127.0.0.1:8080
Web Interface 127.0.0.1:4040
# Conn 0
Avg Conn Time 1.59ms
HTTP Requests
-------------
GET /nutzbook/rs/logo.png 200 OK
没有https的
Forwarding https://xxxx.ngrok.wendal.cn:9080 -> 127.0.0.1:8080
@tuchief 用途是?
@wendal 怎么拿到自己的auth_token
# nutz社区福利 https://nutz.cn/yvr/t/33b68q9106imspallbj4c6aa0p
auth_token=u4p3j5eabug47o7f7cubci63**
# 本地要映射到80的端口,比如你启动服务端口为9090那就填写9090
to_port=8081
# 其他参数请参考项目说明后自行添加 https://github.com/nutzam/nutzmore/tree/master/nutz-plugins-ngrok
我在个人主页上扫描微信,获得auth_token,在windows系统下直接点击bywendal.bat启动,
一直失败,叫我检查token,下载了ngrok.yml,但是没看懂怎么用,求指教。
nutz-plugins-ngrok.properties
中的auth_token怎么配置,还有
ngrok -config ngrok.yml 8080
我是windows7系统,不能再cmd下直接执行。。。
auth_token=2maea0rbaejqqqrvt4i783jnga
to_port=4443
2017-7-24 11:10:45.167 DEBUG [pool-1-thread-14] start socket pipe ...
2017-7-24 11:10:46.191 DEBUG [pool-1-thread-14] bab bad!! can't acccess local po
rt
java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.(Unknown Source)
at java.net.Socket.(Unknown Source)
at org.nutz.plugins.ngrok.client.NgrokClient.newSocket2Local(NgrokClient
.java:239)
at org.nutz.plugins.ngrok.client.NgrokClient$ProxyConn.call(NgrokClient.
java:297)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
to_port的值应该怎么写??
D:\chromedownload\weixin\ngrok客户端>bywendal.bat
D:\chromedownload\weixin\ngrok客户端>java -cp nutz-plugins-ngrok.jar org.nutz.pl
ugins.ngrok.client.NgrokClient -conf_file=nutz-plugins-ngrok.properties
2017-7-24 11:22:21.85 INFO [main] Select SystemLog as Nutz.Log implement
2017-7-24 11:22:21.333 DEBUG [main] Locations for Scans:
[Dir[path=D:\chromedownload\weixin\ngrok客户端], Jar[path=D:\chromedownload\weix
in\ngrok%e5%ae%a2%e6%88%b7%e7%ab%af\nutz-plugins-ngrok.jar], Jar[path=D:\chromed
ownload\weixin\ngrok客户端\nutz-plugins-ngrok.jar]]
2017-7-24 11:22:21.349 INFO [main] same resource path [k客户端/nutz-plugins-ngro
k.properties](nutz-plugins-ngrok.properties/ D:\chromedownload\weixin\ngrok客户
端\nutz-plugins-ngrok.properties) will be override by nutz-plugins-ngrok.proper
ties
2017-7-24 11:22:21.369 DEBUG [main] Found 2 resource by src( nutz-plugins-ngrok.
properties ) , regex( ^.+[.]properties$ )
2017-7-24 11:22:21.376 DEBUG [main] config key=auth_token value=2maea0rbaejqqqrv
t4i783jnga
2017-7-24 11:22:21.395 DEBUG [main] config key=to_port value=8080
2017-7-24 11:22:21.492 DEBUG [main] Using 95 castor for Castors
2017-7-24 11:22:23.208 DEBUG [pool-1-thread-1] write msg = {"Type":"Auth","Paylo
ad":{"Version":"2","MmVersion":"1.7","User":"2maea0rbaejqqqrvt4i783jnga","Passwo
rd":"","OS":"windows","Arch":"386","ClientId":""}}
2017-7-24 11:22:24.235 DEBUG [pool-1-thread-1] read msg = {"Type":"AuthResp","Pa
yload":{"Version":"2","MmVersion":"1.7","ClientId":"tc0vjoevr4j6bqv5mqbv1uk1cd",
"Error":""}}
2017-7-24 11:22:24.240 DEBUG [pool-1-thread-1] write msg = {"Type":"ReqTunnel","
Payload":{"ReqId":"02jh6nf1s2h2lorvsdmkghcueu","Protocol":"http","Hostname":"","
Subdomain":"","HttpAuth":"","RemotePort":0}}
2017-7-24 11:22:24.872 DEBUG [pool-1-thread-1] read msg = {"Type":"NewTunnel","P
ayload":{"ReqId":"02jh6nf1s2h2lorvsdmkghcueu","Url":"http://wx_re04g36pgtit0mc6f
l1u.ngrok.wendal.cn","Protocol":"http","Error":""}}
2017-7-24 11:22:24.877 DEBUG [pool-1-thread-1] ReqId=02jh6nf1s2h2lorvsdmkghcueu
URL=http://wx_re04g36pgtit0mc6fl1u.ngrok.wendal.cn
2017-7-24 11:22:24.881 DEBUG [pool-1-thread-1] read msg = {"Type":"NewTunnel","P
ayload":{"ReqId":"02jh6nf1s2h2lorvsdmkghcueu","Url":"http://wxzre04g36pgtit0mc6f
l1u.ngrok.wendal.cn","Protocol":"http","Error":""}}
2017-7-24 11:22:24.888 DEBUG [pool-1-thread-1] ReqId=02jh6nf1s2h2lorvsdmkghcueu
URL=http://wxzre04g36pgtit0mc6fl1u.ngrok.wendal.cn
2017-7-24 11:22:30.309 DEBUG [pool-1-thread-1] read msg = {"Type":"ReqProxy","Pa
yload":{"ReqId":"02jh6nf1s2h2lorvsdmkghcueu","Url":"http://wxzre04g36pgtit0mc6fl
1u.ngrok.wendal.cn","Protocol":"http","Error":""}}
2017-7-24 11:22:30.309 DEBUG [pool-1-thread-1] read msg = {"Type":"ReqProxy","Pa
yload":{"ReqId":"02jh6nf1s2h2lorvsdmkghcueu","Url":"http://wxzre04g36pgtit0mc6fl
1u.ngrok.wendal.cn","Protocol":"http","Error":""}}
2017-7-24 11:22:30.325 DEBUG [pool-1-thread-1] read msg = {"Type":"ReqProxy","Pa
yload":{"ReqId":"02jh6nf1s2h2lorvsdmkghcueu","Url":"http://wxzre04g36pgtit0mc6fl
1u.ngrok.wendal.cn","Protocol":"http","Error":""}}
2017-7-24 11:22:30.325 DEBUG [pool-1-thread-1] read msg = {"Type":"ReqProxy","Pa
yload":{"ReqId":"02jh6nf1s2h2lorvsdmkghcueu","Url":"http://wxzre04g36pgtit0mc6fl
1u.ngrok.wendal.cn","Protocol":"http","Error":""}}
2017-7-24 11:22:30.341 DEBUG [pool-1-thread-1] read msg = {"Type":"ReqProxy","Pa
yload":{"ReqId":"02jh6nf1s2h2lorvsdmkghcueu","Url":"http://wxzre04g36pgtit0mc6fl
1u.ngrok.wendal.cn","Protocol":"http","Error":""}}
2017-7-24 11:22:30.372 DEBUG [pool-1-thread-3] write msg = {"Type":"RegProxy","P
ayload":{"ClientId":"tc0vjoevr4j6bqv5mqbv1uk1cd"}}
2017-7-24 11:22:30.387 DEBUG [pool-1-thread-5] write msg = {"Type":"RegProxy","P
ayload":{"ClientId":"tc0vjoevr4j6bqv5mqbv1uk1cd"}}
2017-7-24 11:22:30.387 DEBUG [pool-1-thread-4] write msg = {"Type":"RegProxy","P
ayload":{"ClientId":"tc0vjoevr4j6bqv5mqbv1uk1cd"}}
2017-7-24 11:22:30.434 DEBUG [pool-1-thread-6] write msg = {"Type":"RegProxy","P
ayload":{"ClientId":"tc0vjoevr4j6bqv5mqbv1uk1cd"}}
2017-7-24 11:22:30.434 DEBUG [pool-1-thread-7] write msg = {"Type":"RegProxy","P
ayload":{"ClientId":"tc0vjoevr4j6bqv5mqbv1uk1cd"}}
2017-7-24 11:22:31.169 DEBUG [pool-1-thread-3] read msg = {"Type":"StartProxy","
Payload":{"Url":"http://wxzre04g36pgtit0mc6fl1u.ngrok.wendal.cn","ClientAddr":""
}}
2017-7-24 11:22:31.169 DEBUG [pool-1-thread-3] start socket pipe ...
2017-7-24 11:22:32.214 DEBUG [pool-1-thread-3] bab bad!! can't acccess local por
t
java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.(Unknown Source)
at java.net.Socket.(Unknown Source)
at org.nutz.plugins.ngrok.client.NgrokClient.newSocket2Local(NgrokClient
.java:239)
at org.nutz.plugins.ngrok.client.NgrokClient$ProxyConn.call(NgrokClient.
java:297)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
D:\chromedownload\weixin\ngrok客户端>bywendal.bat
D:\chromedownload\weixin\ngrok客户端>java -cp nutz-plugins-ngrok.jar org.nutz.pl
ugins.ngrok.client.NgrokClient -conf_file=nutz-plugins-ngrok.properties
2017-7-24 11:31:11.671 INFO [main] Select SystemLog as Nutz.Log implement
2017-7-24 11:31:11.919 DEBUG [main] Locations for Scans:
[Dir[path=D:\chromedownload\weixin\ngrok客户端], Jar[path=D:\chromedownload\weix
in\ngrok%e5%ae%a2%e6%88%b7%e7%ab%af\nutz-plugins-ngrok.jar], Jar[path=D:\chromed
ownload\weixin\ngrok客户端\nutz-plugins-ngrok.jar]]
2017-7-24 11:31:11.935 INFO [main] same resource path [k客户端/nutz-plugins-ngro
k.properties](nutz-plugins-ngrok.properties/ D:\chromedownload\weixin\ngrok客户
端\nutz-plugins-ngrok.properties) will be override by nutz-plugins-ngrok.proper
ties
2017-7-24 11:31:11.951 DEBUG [main] Found 2 resource by src( nutz-plugins-ngrok.
properties ) , regex( ^.+[.]properties$ )
2017-7-24 11:31:11.959 DEBUG [main] config key=auth_token value=2maea0rbaejqqqrv
t4i783jnga
2017-7-24 11:31:11.974 DEBUG [main] config key=to_port value=8080
2017-7-24 11:31:12.44 DEBUG [main] Using 95 castor for Castors
2017-7-24 11:31:14.641 DEBUG [pool-1-thread-1] write msg = {"Type":"Auth","Paylo
ad":{"Version":"2","MmVersion":"1.7","User":"2maea0rbaejqqqrvt4i783jnga","Passwo
rd":"","OS":"windows","Arch":"386","ClientId":""}}
2017-7-24 11:31:15.867 DEBUG [pool-1-thread-1] read msg = {"Type":"AuthResp","Pa
yload":{"Version":"2","MmVersion":"1.7","ClientId":"2p94fsbkn4j6gruh55gq2l18pi",
"Error":""}}
2017-7-24 11:31:15.873 DEBUG [pool-1-thread-1] write msg = {"Type":"ReqTunnel","
Payload":{"ReqId":"6ng46qnhtmhb7rblaefk6vuro6","Protocol":"http","Hostname":"","
Subdomain":"","HttpAuth":"","RemotePort":0}}
2017-7-24 11:31:16.257 DEBUG [pool-1-thread-1] read msg = {"Type":"NewTunnel","P
ayload":{"ReqId":"6ng46qnhtmhb7rblaefk6vuro6","Url":"http://wx_re04g36pgtit0mc6f
l1u.ngrok.wendal.cn","Protocol":"http","Error":""}}
2017-7-24 11:31:16.260 DEBUG [pool-1-thread-1] ReqId=6ng46qnhtmhb7rblaefk6vuro6
URL=http://wx_re04g36pgtit0mc6fl1u.ngrok.wendal.cn
2017-7-24 11:31:16.263 DEBUG [pool-1-thread-1] read msg = {"Type":"NewTunnel","P
ayload":{"ReqId":"6ng46qnhtmhb7rblaefk6vuro6","Url":"http://wxzre04g36pgtit0mc6f
l1u.ngrok.wendal.cn","Protocol":"http","Error":""}}
2017-7-24 11:31:16.265 DEBUG [pool-1-thread-1] ReqId=6ng46qnhtmhb7rblaefk6vuro6
URL=http://wxzre04g36pgtit0mc6fl1u.ngrok.wendal.cn
2017-7-24 11:31:22.911 DEBUG [pool-1-thread-1] read msg = {"Type":"ReqProxy","Pa
yload":{"ReqId":"6ng46qnhtmhb7rblaefk6vuro6","Url":"http://wxzre04g36pgtit0mc6fl
1u.ngrok.wendal.cn","Protocol":"http","Error":""}}
2017-7-24 11:31:22.927 DEBUG [pool-1-thread-1] read msg = {"Type":"ReqProxy","Pa
yload":{"ReqId":"6ng46qnhtmhb7rblaefk6vuro6","Url":"http://wxzre04g36pgtit0mc6fl
1u.ngrok.wendal.cn","Protocol":"http","Error":""}}
2017-7-24 11:31:22.942 DEBUG [pool-1-thread-1] read msg = {"Type":"ReqProxy","Pa
yload":{"ReqId":"6ng46qnhtmhb7rblaefk6vuro6","Url":"http://wxzre04g36pgtit0mc6fl
1u.ngrok.wendal.cn","Protocol":"http","Error":""}}
2017-7-24 11:31:22.942 DEBUG [pool-1-thread-1] read msg = {"Type":"ReqProxy","Pa
yload":{"ReqId":"6ng46qnhtmhb7rblaefk6vuro6","Url":"http://wxzre04g36pgtit0mc6fl
1u.ngrok.wendal.cn","Protocol":"http","Error":""}}
2017-7-24 11:31:22.942 DEBUG [pool-1-thread-1] read msg = {"Type":"ReqProxy","Pa
yload":{"ReqId":"6ng46qnhtmhb7rblaefk6vuro6","Url":"http://wxzre04g36pgtit0mc6fl
1u.ngrok.wendal.cn","Protocol":"http","Error":""}}
2017-7-24 11:31:23.254 DEBUG [pool-1-thread-6] write msg = {"Type":"RegProxy","P
ayload":{"ClientId":"2p94fsbkn4j6gruh55gq2l18pi"}}
2017-7-24 11:31:23.254 DEBUG [pool-1-thread-4] write msg = {"Type":"RegProxy","P
ayload":{"ClientId":"2p94fsbkn4j6gruh55gq2l18pi"}}
2017-7-24 11:31:23.254 DEBUG [pool-1-thread-5] write msg = {"Type":"RegProxy","P
ayload":{"ClientId":"2p94fsbkn4j6gruh55gq2l18pi"}}
2017-7-24 11:31:23.254 DEBUG [pool-1-thread-7] write msg = {"Type":"RegProxy","P
ayload":{"ClientId":"2p94fsbkn4j6gruh55gq2l18pi"}}
2017-7-24 11:31:23.254 DEBUG [pool-1-thread-3] write msg = {"Type":"RegProxy","P
ayload":{"ClientId":"2p94fsbkn4j6gruh55gq2l18pi"}}
2017-7-24 11:31:25.844 DEBUG [pool-1-thread-4] read msg = {"Type":"StartProxy","
Payload":{"Url":"http://wxzre04g36pgtit0mc6fl1u.ngrok.wendal.cn","ClientAddr":""
}}
2017-7-24 11:31:25.844 DEBUG [pool-1-thread-4] start socket pipe ...
2017-7-24 11:31:45.446 INFO [pool-1-thread-8] srv2loc 19570ms 0kb
2017-7-24 11:31:45.446 DEBUG [pool-1-thread-4] proxy conn exit first at srv2loc
2017-7-24 11:31:45.446 INFO [pool-1-thread-9] loc2srv 19586ms 11kb
```
接口配置信息
请填写接口配置信息,此信息需要你有自己的服务器资源,填写的URL需要正确响应微信发送的Token验证,请阅读消息接口使用指南。
URL http://wxzre04g36pgtit0mc6fl1u.ngrok.wendal.cn
Token 2maea0rbaejqqqrvt4i783jnga
提交
点完提交后,一直弹出配置失败
@wendal 如果能开TCP就好了,有用SSH到公司内网的需求~
@wendal 看例子有https,结果我发现我没有,一看评论没用就关了好可惜,我想微信小程序开发用,我冲这个来,如果真没有话建议那个地址里更新下把https去掉吧
@wendal 请问有多个工程怎么开多个端口,现在每次只能开一个端口,比如我用了80之前那个8080就用不了了
@wendal 我看到有介绍说开通多个隧道
tunnels:
tunnel1:
subdomain:web
proto:
http:8080
tunnel2:
subdomain:git
proto:
tcp:80
这样可行吗
@lgxlyh 不支持
@wendal ok吗?
请 wendal 帮忙看看
./ngrok -config ngrok.yml 80
failed MSpanList_Insert 0xf0c000 0xa24e2d5e7c10 0x0
fatal error: MSpanList_Insert
runtime stack:
@wendal 收到,谢谢
这个地址 https://ngrok.com/download/1 下载不了 ngrok.yml 了
Tunnel Status reconnecting Version 1.7/ Web Interface 127.0.0.1:4040 # Conn 0 Avg Conn Time 0.00ms
这是什么问题 大佬
启动不了
[02/04/21 11:40:15] [INFO] Reading configuration file ngrok.yml
[02/04/21 11:40:15] [INFO] [client] Trusting host's root certificates
[02/04/21 11:40:15] [INFO] [view] [web] Serving web interface on 127.0.0.1:4040
[02/04/21 11:40:15] [INFO] Checking for update
[02/04/21 11:40:16] [DEBG] [ctl:4acbb12] New connection to: 112.125.89.8:4443
[02/04/21 11:40:16] [DEBG] [ctl:4acbb12] Writing message: {"Type":"Auth","Payload":{"Version":"2","MmVersion":"1.7","User":"48dgv6osbeirvoa5sba8cami0f","Password":"","OS":"windows","Arch":"386","ClientId":""}}
[02/04/21 11:40:16] [DEBG] [ctl:4acbb12] Waiting to read message
[02/04/21 11:40:16] [DEBG] [ctl:4acbb12] Reading message with length: 97
[02/04/21 11:40:16] [DEBG] [ctl:4acbb12] Read message {"Type":"AuthResp","Payload":{"Version":"2","MmVersion":"1.7","ClientId":"","Error":"AuthError"}}
[02/04/21 11:40:16] [DEBG] [ctl:4acbb12] Closing
[02/04/21 11:40:16] [INFO] Waiting 1 seconds before reconnecting
[02/04/21 11:40:16] [INFO] [controller] Shutting down
Failed to authenticate to server: AuthError