ngrok对我来说只转发到HTTPS,当其他服务试图访问端点时,这会给出SSL证书错误。
大多数时候ngrok转发到http和https,但出于某种原因,我的ngrok只在使用命令ngrok http 4554 --host-header=localhost:4554
后转发到https:如何强制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
如果我们的代码在PORT 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