Ngrok local system is mapped to the external network

I. Overview

    ngrok is a reverse proxy that establishes a secure channel between a public endpoint and a locally running web server. ngrok captures and analyzes traffic on all channels for later analysis and replay

2. Function

1. Before use

    As a web developer, we sometimes need to temporarily deploy a local web site to the external network for others to experience evaluation or assist in debugging, etc. Usually we do:

  1. Find a web server running on the external network

  2. There is an environment required by the website on the server, otherwise build it by yourself

  3. Deploy the website to the server

  4. After debugging, delete the website from the server

2. After use

    1. First register and download ngrok, get a string of authorization codes
    2. Run the command ngrok -authtoken Your authorization code 80, 80 is the port of your local web service, and then ngrok will remember your authorization code, just ngrok 80 OK
    3. You will get a string of URLs, through which you can access your local web service

3. Examples

1 Introduction

    The ngrok service can assign you a domain name so that your local web project can be accessed from the external network, which is especially suitable for showing your local web demo to others and debugging some remote APIs (such as WeChat public account, enterprise account development) ngrok's The official service can be  viewed here.  For some reasons, some students may not be able to open the official website and cannot access it in China. Fortunately, the code of ngrok 1 version is open source. Bendi happens to have an unexpired cloud server, and a good friend has selflessly contributed a registered domain name. In the spirit of being alone is not as good as everyone's Lele, Ben has worked tirelessly to build an ngrok service to benefit developers.

2. Use the tutorial

●windows用户:
1,下载windows版本的客户端,解压到你喜欢的目录
2,在命令行下进入到path/to/windows_386/下
3,执行 ngrok -config=ngrok.cfg -subdomain xxx 80 //(xxx 是你自定义的域名前缀)
4,如果开启成功 你就可以使用 xxx.tunnel.qydev.com 来访问你本机的 127.0.0.1:80 的服务啦
5,如果你自己有顶级域名,想通过自己的域名来访问本机的项目,那么先将自己的顶级域名解析到123.57.165.240(域名需要已备案哦),然后执行 ngrok -config=ngrok.cfg -hostname xxx.xxx.xxx 80 //(xxx.xxx.xxx是你自定义的顶级域名)
6,如果开启成功 你就可以使用你的顶级域名来访问你本机的 127.0.0.1:80 的服务啦
7,如果失败 就加下交流群 反馈下问题 本屌会看看什么原因....吧
●linux用户:
只在ubuntu14.04 amd64 下测试没有问题
1,下载linux版本的客户端,解压到你喜欢的目录,注意:要给ngrok文件的可执行权限
2,在命令行下进入到path/to/linux_amd64/下
3,执行 ./ngrok -config=ngrok.cfg -subdomain xxx 80 //(xxx 是你自定义的域名前缀)
4,如果开启成功 你就可以使用 xxx.tunnel.qydev.com 来访问你本机的 127.0.0.1:80 的服务啦
5,如果你自己有顶级域名,想通过自己的域名来访问本机的项目,那么先将自己的顶级域名解析到123.57.165.240 (域名需要已备案哦),然后执行./ngrok -config=ngrok.cfg -hostname xxx.xxx.xxx 80 //(xxx.xxx.xxx是你自定义的顶级域名)
6,如果开启成功 你就可以使用你的顶级域名来访问你本机的 127.0.0.1:80 的服务啦
7,最近有很多同学提到需要linux32位与arm版本,这边也新增了两个客户端,由于本屌没有相应设备或环境,请自行测试,如果有问题,可以反馈。
8,如果失败 就加下交流群 反馈下问题 本屌会看看什么原因....吧
●Mac 用户:
1,呃,虽然提供了mac版的客户端,但是本屌
2,没有Mac
3,没有Mac
4,没有Mac(重要的事情要说3遍)
5,所以你下载了之后 自己琢磨吧(应该和linux的使用一样....吧).......
●其他使用方法
1,呃,虽然搭建了ngrok服务,但是实际上上面的教程只介绍了一些简单的操作
2,ngrok还有许多使用方法,大家可以多了解探索一下 
3,比如,同时开启多个服务,TCP端口转发,这些大家可以在.cfg上进行配置,本屌就不一一叙述了。

Reference address: https://baike.baidu.com/item/ngrok/13986278

https://blog.csdn.net/qq_26101151/article/details/53114496?locationNum=4&fps=1

Reference link 2 (including resource download address)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325293153&siteId=291194637