搜索
您的当前位置:首页正文

MAC下使用免费实现内网穿透

来源:二三娱乐

一、环境

MacOS Mojava(此条件非必须)

二、

屏幕快照 2019-01-27 下午12.15.00.png

三、使用

1、下载之后直接解压得到 一个 ngrok 文件

2、直接终端运行

➜ chmod a+x ngrok

即可修改权限。

3、开启服务

➜ ./ngrok http localhost:8080

4、结果如下:


屏幕快照 2019-01-27 下午12.19.44.png
http://8dfccac4.ngrok.io
https://8dfccac4.ngrok.io

四、问题

需要主要的是!!!!➜ 必须开启web服务

若没开启出现如下错误:

**Failed to complete tunnel connection**

The connection to [**https://8dfccac4.ngrok.io**](https://8dfccac4.ngrok.io/) was successfully tunneled to your ngrok client, but the client failed to establish a connection to the local address [**localhost:8080**](http://localhost:8080/).

Make sure that a web service is running on [**localhost:8080**](http://localhost:8080/) and that it is a valid address.

The error encountered was: **dial tcp** [**::1**]**:8080: getsockopt: connection refused**
Top