如何强制ngrok转发到http而不是https?

问题描述 投票:0回答:3

ngrok 只为我转发到 https,当其他服务尝试访问端点时,它会给出 ssl 证书错误。

大多数时候,ngrok 转发到 http https,但由于某种原因,我的 ngrok 仅在使用以下命令后转发到 https:“ngrok http 4554 --host-header=localhost:4554”

如何强制 ngrok 转发到 http 而不是 https?

api endpoint portforwarding ngrok
3个回答
13
投票

要转发到http,您需要使用方案标志,如下所示:

ngrok http --scheme=http 4545 --host-header=localhost:4545

这将指定 ngrok 转发到 http,并且生成的端点将是 http 而不是 https。


1
投票

转发至http:

ngrok http --bind-tls false

转发至https:

ngrok http --bind-tls true

0
投票

如果我们的代码在端口 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
© www.soinside.com 2019 - 2024. All rights reserved.