简体   繁体   English

ngrok 从 windows 7 命令行杀死隧道

[英]ngrok killing a tunnel from windows 7 command line

I'm trying to use ngrok to foward my app, currently hosted on localhost:3602, to my development partner.我正在尝试使用 ngrok 将我的应用程序(目前托管在 localhost:3602 上)转发给我的开发合作伙伴。

I've done this many times in the past successfully, simply by typing in过去我已经成功地完成了很多次,只需输入

ngrok http 3602

I get back a url that he can conntect to.我取回了一个他可以连接到的 url。 But now when I type that in I get the following error message:但是现在当我输入它时,我收到以下错误消息:

Tunnel session failed.隧道 session 失败。 Your account is limited to 1 simultaneous ngrok client session. Active ngrok client sessions in region 'us': - f21bd0dbe67928069054c733a5e11f88 (54.80.69.18) ERR_NGROK_108您的帐户仅限于 1 个并发 ngrok 客户端 session。区域“我们”中的活动 ngrok 客户端会话:- f21bd0dbe67928069054c733a5e11f88 (54.80.69.18) ERR_NGROK_108

Obviously I must have an existing tunnel session running somewhere.显然,我必须在某处运行现有隧道 session。

My problem is I have no idea where to find that existing tunnel session and how to terminate it.我的问题是我不知道在哪里可以找到现有隧道 session 以及如何终止它。 It does not exist as either a running application, process or service in the task manager, and I can find no syntax in the documentation for how to terminate a tunnel session. I've tried rebooting my machine to no effect, which tells me this is probably not a local problem, but rather something running on the ngrok site linked to my account, yet nothing I can find in my account settings indicates anything helpful.它在任务管理器中不作为正在运行的应用程序、进程或服务存在,我在文档中找不到有关如何终止隧道 session 的语法。我尝试重新启动我的机器但没有效果,这告诉我这个可能不是本地问题,而是在链接到我的帐户的 ngrok 站点上运行的问题,但我在帐户设置中找不到任何有用的信息。

Can anyone provide the necessary command to clear up this problem.任何人都可以提供必要的命令来解决这个问题。 Thanks.谢谢。

for window version:对于窗口版本:

tskill /A ngrok

在此处输入图片说明

Try this, worked like a charm for me试试这个,对我来说就像一个魅力

killall ngrok

[Update] [更新]

I'm forgot an important thing, this command is an Unix command, so works only on Mac or Linux.我忘了一件重要的事情,这个命令是一个 Unix 命令,所以只适用于 Mac 或 Linux。 In Windows maybe you can open the Task Manager and close all ngrok processes.在 Windows 中,也许您可​​以打开任务管理器并关闭所有 ngrok 进程。

It seems like ngrok got a (JavaScript) function for that:似乎ngrok有一个(JavaScript)函数:

const ngrok = require('ngrok');
ngrok().kill();

This answer is not about killing tunnel, but about a possible solution to the described problem with ERR_NGROK_108.这个答案不是关于杀死隧道,而是关于 ERR_NGROK_108 所描述问题的可能解决方案。

https://dashboard.ngrok.com/get-started/setup describes a simple plan for getting started with ngrok. https://dashboard.ngrok.com/get-started/setup描述了一个开始使用 ngrok 的简单计划。

在此处输入图片说明

If you execute the second step you will have a file ngrok.yaml (In my case path was: C:\\Users\\Mi\\ .ngrok2\\ngrok.yml ).如果您执行第二步,您将拥有一个文件 ngrok.yaml (在我的情况下,路径是: C:\\Users\\Mi\\ .ngrok2\\ngrok.yml )。

And after that executing ngrok http 80 will provide the described error ERR_NGROK_108.之后执行ngrok http 80将提供所描述的错误 ERR_NGROK_108。

Solution:解决方案:

  • Skip the second step .跳过第二步 Execute ngrok http 80 without previous ngrok authtoken在没有以前的ngrok authtoken情况下执行ngrok http 80
  • If you have already executed this step, delete the file ngrok.yml如果你已经执行了这一步,删除文件ngrok.yml

This approach solved my problem with ERR_NGROK_108.这种方法用 ERR_NGROK_108 解决了我的问题。

If you are limited to one session — like I was.如果您仅限于一个 session - 就像我一样。 Then you may have created an account with ngrok and signed in with your machine.然后您可能已经使用ngrok创建了一个帐户并使用您的计算机登录。 And it'll create a file:它会创建一个文件:

C:\Users\<name>\.ngrok2\ngrok.yml

It uses this to limit your client, simply delete this file.它使用它来限制您的客户端,只需删除此文件。

on your ngrok prompt just run this command在你的 ngrok 提示符下运行这个命令

taskkill /f /im ngrok.exe taskkill /f /im ngrok.exe

On Windows(cmd):在 Windows 上(命令):

taskkill /f /im ngrok.exe

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM