美文网首页工具
MAC下使用免费实现内网穿透

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

作者: Evans_Xiao | 来源:发表于2019-01-27 12:29 被阅读34次

一、环境

MacOS Mojava(此条件非必须)

二、ngrok

下载地址:https://ngrok.com/download

屏幕快照 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

5、http、https服务器即可通过手机4G网络访问:

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**

相关文章

网友评论

    本文标题:MAC下使用免费实现内网穿透

    本文链接:https://www.haomeiwen.com/subject/mvpgjqtx.html