ngrok错误无法读取有效的http请求:格式错误的HTTP请求

时间:2017-07-12 10:16:43

标签: linux tunnel ngrok

我正在使用ngrok构建到localhost服务器的安全隧道

在服务器端,我运行命令start ngrok

./bin/ngrokd -domain="tunnel.kmic168.com" -httpAddr=":8080"

显示

[07/12/17 17:37:16] [INFO] [registry] [tun] No affinity cache specified
[07/12/17 17:37:16] [INFO] [metrics] Reporting every 30 seconds
[07/12/17 17:37:16] [INFO] Listening for public http connections on [::]:8080
[07/12/17 17:37:16] [INFO] Listening for public https connections on [::]:443
[07/12/17 17:37:16] [INFO] Listening for control and proxy connections on [::]:4443

看起来很好。然后我在客户端运行命令

./ngrok -subdomain=rbp -config="ngrok.cfg" 80

Tunnel Status: reconnecting .

总是重新连接。然后我检查服务器端显示这些错误

  

[07/12/17 17:40:13] [INFO] [pub:7ac836d4]来自的新连接   119.130.171.143:25904 [07/12/17 17:40:13] [警告] [pub:7ac836d4]无法读取有效的http请求:格式错误的HTTP请求   “\ X16 \ X03 \ X01 \ X00 \ x9a \ X01 \ X00 \ X00 \ X96 \ X03 \ X03; Qߓ\ xccj \ xb7nm \ XA0 \ xe0 \ 86 \ X04 \ u007fH {W5 \ X10 \ XB1 \ XC4 \ XCC \固定的\ xe5 \ XBF \ xc9 \ X00 \xa1ĥbq\ X00 \ X00 \ X1C \ XC0 / \ XC0 + \ xc00 \ XC0,\ XC0 \ X13 \ XC0 \吨\ XC0 \ X14 \ XC0"   [07/12/17 17:40:13] [DEBG] [pub:7ac836d4]闭幕[07/12/17 17:40:23]   [INFO] [metrics]报告:   { “bytesIn.count”:0 “bytesOut.count”:0 “connMeter.count”:0 “connMeter.m1”:0 “httpTunnelMeter.count”:0,的 “linux”:0 “OSX” :0, “其他”:0, “tcpTunnelMeter.count”:0 “tunnelMeter.count”:0 “tunnelMeter.m1”:0, “窗口”:0}

这是我的cfg文件内容

server_addr: "tunnel.kmic168.com:8080"
trust_host_root_certs: false

是否有解决此错误的解决方案?非常感谢你!

1 个答案:

答案 0 :(得分:1)

最后我找到了解决方案

https://gist.github.com/lyoshenka/002b7fbd801d0fd21f2f

你必须使用端口4443