shly / Blog-New

学习笔记
0 stars 0 forks source link

ngrok——使用外网访问内网server #13

Open shly opened 6 years ago

shly commented 6 years ago

暂时还没仔细看,但是测试了一下使用方式。 1 下载ngork 官网地址 https://ngrok.com/ 2 官网注册,可以使用github授权 3 双击下载的ngork.exe 3 启动本地项目server 4 启动新的命令行窗口,运行ngrok http 5000 (5000是本地项目运行端口)

Session Status                online
Session Expires               7 hours, 48 minutes
Version                       2.2.8
Region                        United States (us)
Web Interface                 http://127.0.0.1:4040
Forwarding                    http://ed1674a6.ngrok.io -> localhost:5000
Forwarding                    https://ed1674a6.ngrok.io -> localhost:5000

Connections                   ttl     opn     rt1     rt5     p50     p90
                              2       0       0.00    0.00    5.40    5.79

之后可以使用手机测试访问https://ed1674a6.ngrok.io

shly commented 6 years ago

双击ngork时的输出

NAME:
   ngrok - tunnel local ports to public URLs and inspect traffic

DESCRIPTION:
    ngrok exposes local networked services behinds NATs and firewalls to the
    public internet over a secure tunnel. Share local websites, build/test
    webhook consumers and self-host personal services.
    Detailed help for each command is available with 'ngrok help <command>'.
    Open http://localhost:4040 for ngrok's web interface to inspect traffic.

EXAMPLES:
    ngrok http 80                    # secure public URL for port 80 web server
    ngrok http -subdomain=baz 8080   # port 8080 available at baz.ngrok.io
    ngrok http foo.dev:80            # tunnel to host:port instead of localhost
    ngrok tcp 22                     # tunnel arbitrary TCP traffic to port 22
    ngrok tls -hostname=foo.com 443  # TLS traffic for foo.com to port 443
    ngrok start foo bar baz          # start tunnels from the configuration file

VERSION:
   2.2.8

AUTHOR:
  inconshreveable - <alan@ngrok.com>

COMMANDS:
   authtoken    save authtoken to configuration file
   credits      prints author and licensing information
   http         start an HTTP tunnel
   start        start tunnels by name from the configuration file
   tcp          start a TCP tunnel
   tls          start a TLS tunnel
   update       update ngrok to the latest version
   version      print the version string
   help         Shows a list of commands or help for one command

ngrok is a command line application, try typing 'ngrok.exe http 80'
at this terminal prompt to expose port 80.

功能和使用方式已经写的很明白了