NutzCN Logo
精华 社区福利 Ngrok新版客户端
发布于 597天前 作者 pangwu86 3097 次浏览 复制 上一个帖子
标签:

项目说明

由伟大的wendal同学写的java版ngrok客户端
项目地址:https://github.com/nutzam/nutzmore/tree/master/nutz-plugins-ngrok

下载地址: https://pan.baidu.com/s/1jIfYwL4

下载后请查看README.txt

使用说明

  1. 确保机器上已经配置好了java运行环境
  2. 配合nutz社区福利 https://nutz.cn/yvr/t/33b68q9106imspallbj4c6aa0p 拿到你自己的auth_token
  3. 修改目录下nutz-plugins-ngrok.properties, 填写auth_token与to_port(客户端默认占用9080,请不要使用)
  4. linux或mac命令行下执行 bywendal.sh,windows下在cmd中执行 bywendal.bat
22 回复

周末上线Ngrok新版服务器端

@wendal 整个 server/client的部署说明吧

@wendal server部署说明 整理下吧 ,是不是需要配置nginx ?

运行异常

2017-4-6 11:6:21.299 DEBUG [pool-1-thread-38] something happen. proxy conn is lo
se
2017-4-6 11:6:21.299 DEBUG [pool-1-thread-39] something happen. proxy conn is lo
se
java.net.SocketTimeoutException: Read timed out
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.socketRead(Unknown Source)
        at java.net.SocketInputStream.read(Unknown Source)
        at java.net.SocketInputStream.read(Unknown Source)
        at sun.security.ssl.InputRecord.readFully(Unknown Source)
        at sun.security.ssl.InputRecord.read(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.readDataRecord(Unknown Source)
        at sun.security.ssl.AppInputStream.read(Unknown Source)
        at java.io.DataInputStream.readFully(Unknown Source)
        at java.io.DataInputStream.readFully(Unknown Source)
        at org.nutz.plugins.ngrok.client.NgrokAgent.readMsg(NgrokAgent.java:40)
        at org.nutz.plugins.ngrok.client.NgrokClient$ProxyConn.call(NgrokClient.
java:291)
        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)
2017-4-6 11:6:21.315 DEBUG [pool-1-thread-37] something happen. proxy conn is lo
se
java.net.SocketTimeoutException: Read timed out
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.socketRead(Unknown Source)
        at java.net.SocketInputStream.read(Unknown Source)
        at java.net.SocketInputStream.read(Unknown Source)
        at sun.security.ssl.InputRecord.readFully(Unknown Source)
        at sun.security.ssl.InputRecord.read(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.readDataRecord(Unknown Source)
        at sun.security.ssl.AppInputStream.read(Unknown Source)
        at java.io.DataInputStream.readFully(Unknown Source)
        at java.io.DataInputStream.readFully(Unknown Source)
        at org.nutz.plugins.ngrok.client.NgrokAgent.readMsg(NgrokAgent.java:40)
        at org.nutz.plugins.ngrok.client.NgrokClient$ProxyConn.call(NgrokClient.
java:291)
        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)
java.net.SocketTimeoutException: Read timed out
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.socketRead(Unknown Source)
        at java.net.SocketInputStream.read(Unknown Source)
        at java.net.SocketInputStream.read(Unknown Source)

"Read timed out"是一小时之后才会出现的东西

不能一直连接吗

能啊, 要是一小时之后才报这个, 并没有什么问题

一小时候就挂了 就不能连

提供一下出错前的日志

@qq_c1e9e547 已修复,服务器端逻辑的问题

连接成功后,浏览器输入地址返回 是什么情况?
Invalid Host header

输入的是啥?

就是输入的http://qqzba024238.ngrok.wendal.cn这个嘛,映射的地址

请问这个问题怎么解决呢?
连接成功后,浏览器输入映射地址(http://qqzba024238.ngrok.wendal.cn)返回 Invalid Host header

Invalid Host header,如果是代理的 npm 跑的 webpack-dev-server 的话在 package.json 中 dev 的命令行中加入 --public 即可

@wendal 请问在macos里面需要怎么配置, 这边配置后 无法启动
./ngrok -config /etc/ngrok.yml 8080
failed MSpanList_Insert 0xe0c000 0x1ecab6e9d51b 0x0
fatal error: MSpanList_Insert

用java版吧

嗯,放弃了macos的了,使用了此贴上面的 jar运行成功可以访问

添加回复
请先登陆
回到顶部