ngrok 只为我转发到 https,当其他服务尝试访问端点时,它会给出 ssl 证书错误。
大多数时候,ngrok 转发到 http 和 https,但由于某种原因,我的 ngrok 仅在使用以下命令后转发到 https:“ngrok http 4554 --host-header=localhost:4554”
如何强制 ngrok 转发到 http 而不是 https?
要转发到http,您需要使用方案标志,如下所示:
ngrok http --scheme=http 4545 --host-header=localhost:4545
这将指定 ngrok 转发到 http,并且生成的端点将是 http 而不是 https。
转发至http:
ngrok http --bind-tls false
转发至https:
ngrok http --bind-tls true
如果我们的代码在端口 443 中运行,那么它不会转换为 http,因此请尝试使用不安全端口,例如 4545、8081 或其他端口。然后就可以正常工作了。
步骤1:
Run your code with un Secure Port like as 4545, 8081, 9898 or others
第2步:
使用相同的代码端口运行此命令。
ngrok http --scheme=http 8081 --host-header=localhost:8081