问题标签 [ngrok]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
714 浏览

tunnel - Ngrok 不为 http 请求提供服务

我已经使用 ngrok 一段时间了,今天我启动了它,但它似乎没有接受请求......我通过查看 localhost:4040 的网络界面确认了这一点,它显示没有传入的请求。目前我只是看到这个:

在此处输入图像描述

有什么想法可能导致这种情况吗?

0 投票
0 回答
37 浏览

meteor - Json Endpoint 未被其他系统消化

我的 json 端点在浏览器上请求时完美运行,它显示原始 json 。但是当我使用其他系统时,例如 zappier,它并不能很好地消化我的 json。我正在使用 Ngrok 与我的 localhost 建立隧道,这就是我在 ngrok 仪表板上得到的内容。 在此处输入图像描述

它与某种压缩有关吗?

0 投票
3 回答
4830 浏览

ngrok - 使用自定义子域启动 ngrok

假设我有一个子域,例如可爱设计。现在我想创建一个具有以下子域的网络服务器。是否可以每次使用此子域自动启动 ngrok?

0 投票
1 回答
5234 浏览

php - 隧道通过 ngrok 剥离风格和主题的 wordpress 网站

我在 localhost 的 IIS 上有一个 wordpress 站点。为了演示该站点,我使用ngrok使该站点可用。

在 localhost 上查看该站点时,一切看起来都很好。但是,当我通过 ngrok 隧道远程查看该站点时,会出现内容,但会丢失所有样式和主题元素。

我不确定哪些代码、配置或文档有助于解决这个问题。

知道为什么会发生这种情况吗?

0 投票
2 回答
8528 浏览

iis - Using ngrok with IISExpress on windows

I'm used to using a Mac, and ngrok is a breeze; all you need to do is specify a port, but I'm new to IISExpress, and I can't figure out how to use ngrok and/or IIS correctly. To be clear, I've inherited a Windows machine from a coworker (who has left the company) and the set up works great locally.

The local url is similar to:

In the bindings section of IIS, I've got:

I've used this page for reference: https://www.twilio.com/blog/2014/03/configure-windows-for-local-webhook-testing-using-ngrok.html

The instructions seem reasonable, but they don't work for me. These instructions indicate that the file applicationhost.config needs to be altered for IIS. I have found this file, and found the correct section for the site I need to ngrok. The binding info does not match what's in the IIS gui though:

As per the instructions, I have added:

(Here every time I run ngrok on windows I get ngrok.io instead of ngrok.com, which seems odd. I've tried accessing both ways with no luck.)

I have restarted the site on IIS (in the actions menu). When I try to access the ngrok url from a remote machine, ngrok returns 502 bad gateway, and the remote machine shows:

When I try to go to localhost:4085 locally, I get "This webpage is not available". When I try to go to localhost:80, I get a redirect to a different site the IIS is serving. When I try 127.0.0.1:80, I get a 404 error.

I have tried using netstat -a -b, and have tried all of the ports associated with 127.0.0.1, and nothing turns up the correct site (yet still thing.somedomain.com still works correctly).

I'm completely mystified, and don't know what to try next, or where the problem lies (in how I'm starting ngrok, in how I'm accessing ngrok, in how the bindings are mapped, in how IIS restarts, a firewall issue, or some other voodoo). This should be bloody simple!

0 投票
3 回答
25209 浏览

http - 通过ngrok隧道一个localhost子目录?

目标:想要使用 ngrok 共享网站预览,它创建一个隧道,可以从该隧道中看到我的本地主机,其 url 类似于mywebsite.ngrok.io

问题:我使用 WAMP,我的 localhost 文件夹看起来像这样:

要访问我localhost/website1/在浏览器中键入的网站,我只想通过隧道传输该 URL,可能的解决方案是:

  1. 设置一个虚拟主机,我会经历手动设置虚拟主机的麻烦,然后我会得到类似 website1.dev 的东西,然后我会将它作为 HTTP 请求中的主机头传递给 ngrok,如下所示

    我不明白主机头是什么,为什么我不能传递一个相对 url localhost/website1/,还有什么是重写选项?

  2. 将我的本地主机的文件夹目录更改为网站的文件夹,我不想这样做。

有没有更好的方法以更简单的方式实现我的目标,也许是通过 WAMP 别名?

0 投票
20 回答
152178 浏览

macos - 未找到 ngrok 命令

我正在尝试ngrok在我 1 周大的优胜美地上安装(我已经在 Windows 上使用了一段时间,没有任何问题),这些是我到目前为止所遵循的步骤。

  1. 从这里下载 ngrok https://ngrok.com/download

  2. 解压缩文件并将 Unix 可执行文件复制到应用程序中。

现在据我了解,我只需要打开终端,进入应用程序文件夹并写入ngrok http 80. 结果是“找不到命令”。

我什至在ngrok网站上注册并从终端运行命令./ngrok authtoken "blablabla",结果是“没有这样的文件或目录”

谁能告诉我如何继续激活隧道ngrok

0 投票
7 回答
109466 浏览

asp.net - 通过隧道(使用 ngrok)将 localhost 暴露到 Internet:HTTP 错误 400:错误请求;无效的主机名

从以前版本的问题中,有这样的:Browse website with ip address 而不是 localhost,它几乎概述了我到目前为止所做的事情......我已经让本地 IP 正常工作。然后我找到了ngrok,显然我不需要通过IP连接。


我想要做的是将我在 localhost 上运行的网站暴露给互联网。我找到了一个可以做到这一点的工具:ngrok。

在 Visual Studio 中运行该网站,该网站在 localhost/port# 上启动。我在命令行中运行命令“ngrok http port#”。一切似乎都开始正常。我生成了几个 URL,并且 ngrok 检查 url (localhost:4040) 有效。

唯一的问题是,当我转到生成的 URL 时,我收到 HTTP 错误 400:错误请求无效主机名。这是一个与我运行“ngrok http wrongport#”时不同的错误,这是一个找不到主机的错误......所以我认为正在发生一些好事。我就是说不出来是什么...

通过隧道服务将我的网站暴露在互联网上时,我是否缺少步骤?如果有,我在 ngrok 文档中找不到。

0 投票
1 回答
32730 浏览

linux - 无法通过 ngrok SSH 进入远程 Linux

远程 Linux 计算机位于内部网络中,并且没有公共 IP 地址。所以我安装了ngrok。

ngrok by @inconshreveable (Ctrl+C to quit) Tunnel Status online
Version 2.0.19/2.0.17
Web Interface http://127.0.0.1:4040
Forwarding tcp://0.tcp.ngrok.io:36428 -> localhost :22
连接 ttl opn rt1 rt5 p50 p90
0 0 0.00 0.00 0.00 0.00

我检查了 sshd 是否正在运行。

在本地PC上,我尝试了

这导致了

ssh:连接到主机 ngrok.com 端口 36428:连接被拒绝

0 投票
4 回答
33090 浏览

ngrok - 错误请求 - 无效主机名 HTTP 错误 400。请求主机名无效。当我使用 ngrok

当我使用ngrok& 运行 ngrok 给出的 url 时,配置如下:

  • 我的本地网址是:localhost:8080/someexample
  • 我的ngrok网址是:http://f07d0862.ngrok.io/

它显示此错误: