ngrok 错误无法读取有效的 http 请求:格式错误的 HTTP 请求
ngrok error Failed to read valid http request: malformed HTTP request
我正在使用 ngrok 构建到本地主机服务器的安全隧道
在服务器端我 运行 命令启动 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] New connection from
119.130.171.143:25904 [07/12/17 17:40:13] [WARN] [pub:7ac836d4] Failed to read valid http request: malformed HTTP request
"\x16\x03\x01\x00\x9a\x01\x00\x00\x96\x03\x03;Qߓ\xccj\xb7nm\xa0\xe0\x86\x04\u007fH{W5\x10\xb1\xc4\xcc\xed\xe5\xbf\xc9\x00\xa1ĥbq\x00\x00\x1c\xc0/\xc0+\xc00\xc0,\xc0\x13\xc0\t\xc0\x14\xc0"
[07/12/17 17:40:13] [DEBG] [pub:7ac836d4] Closing [07/12/17 17:40:23]
[INFO] [metrics] Reporting:
{"bytesIn.count":0,"bytesOut.count":0,"connMeter.count":0,"connMeter.m1":0,"httpTunnelMeter.count":0,"linux":0,"osx":0,"other":0,"tcpTunnelMeter.count":0,"tunnelMeter.count":0,"tunnelMeter.m1":0,"windows":0}
这是我的cfg文件内容
server_addr: "tunnel.kmic168.com:8080"
trust_host_root_certs: false
是否有解决此错误的方法?非常感谢!
终于找到解决方法
https://gist.github.com/lyoshenka/002b7fbd801d0fd21f2f
您必须使用端口 4443
我正在使用 ngrok 构建到本地主机服务器的安全隧道
在服务器端我 运行 命令启动 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] New connection from 119.130.171.143:25904 [07/12/17 17:40:13] [WARN] [pub:7ac836d4] Failed to read valid http request: malformed HTTP request "\x16\x03\x01\x00\x9a\x01\x00\x00\x96\x03\x03;Qߓ\xccj\xb7nm\xa0\xe0\x86\x04\u007fH{W5\x10\xb1\xc4\xcc\xed\xe5\xbf\xc9\x00\xa1ĥbq\x00\x00\x1c\xc0/\xc0+\xc00\xc0,\xc0\x13\xc0\t\xc0\x14\xc0" [07/12/17 17:40:13] [DEBG] [pub:7ac836d4] Closing [07/12/17 17:40:23] [INFO] [metrics] Reporting: {"bytesIn.count":0,"bytesOut.count":0,"connMeter.count":0,"connMeter.m1":0,"httpTunnelMeter.count":0,"linux":0,"osx":0,"other":0,"tcpTunnelMeter.count":0,"tunnelMeter.count":0,"tunnelMeter.m1":0,"windows":0}
这是我的cfg文件内容
server_addr: "tunnel.kmic168.com:8080"
trust_host_root_certs: false
是否有解决此错误的方法?非常感谢!
终于找到解决方法
https://gist.github.com/lyoshenka/002b7fbd801d0fd21f2f
您必须使用端口 4443