ngrok 本机服务器映射到外网域名
来源:互联网 发布:淘宝的华歌尔是正品吗 编辑:程序博客网 时间:2024/05/16 00:56
今天看到同事自己服务器上有申请的一个域名,而且前一部分是自定义的,比较好奇怎么搞的,自己摸索了个简单的方法,但是域名不能自定义,比较蛋疼。
步骤如下:
1.首先下载 ngrok
https://ngrok.com/download ,下载对应的系统版本,本人下载的ngrok Windows 64-Bit版本。
下载完就看到 zip包,解压后 就看到一个文件 ngrok.exe
双击运行ngrok.exe, 就出来个dos框,里面有ngrok的命令帮助。
2 启动个本机项目
比如我的 :http://127.0.0.1:3002/
3 项目启动了,ngrok启动了,就需要用ngrok来把本机项目映射到外网域名。
具体操作:在 dos框中 ngrok命令目录下输入命令 :ngrok http 3002
这时就会出现 ngrok by @inconshreveable 对话框 里面信息如下:
Session Status online
Version 2.2.8
Region United States (us)
Web Interface http://127.0.0.1:4040
Forwarding http://577068fc.ngrok.io-> localhost:3002
Forwarding https://577068fc.ngrok.io -> localhost:3002
这时我们就可以访问标红 url来访问自己的项目了。
----------------------------------------------------------------------------------------------------------------------
自定义域名方法:
https://ngrok.com/ 登录,可以用github账号登录。
登录后就看到自己的认证码,然后执行:
ngrok authtoken 7mtXN9BGKZspoQHYeK9TJ_7eHcqQKmnjgr8WBC
带上认证后设置域名:ngrok http -subdomain=candaoD 3002
遗憾的是: 因为我的账号是免费的,升级到商业计划才能自定义。商业计划需要付费。
提示如下:
Tunnel session failed: Only paid plans may bind custom subdomains.
Failed to bind the custom subdomain 'candaoD' for the account 'yangqjiayou'.
This account is on the 'Free' plan.
Upgrade to a paid plan at: https://dashboard.ngrok.com/billing/plan
ERR_NGROK_313
有大神知道如何免费加点自定义域名,请留言评论,不吝指导,谢谢。
- ngrok 本机服务器映射到外网域名
- ngrok映射到本机ip自定义域名
- ngrok 本地域名映射
- 映射本机到外网ngrok
- ngrok实现域名映射外网
- 配置本机域名与ip映射
- 域名和本机ip地址映射
- ngrok映射端口到外网
- Ngrok 内网 映射到外网
- 本机作为服务器让外网访问——Sunny-Ngrok内网转发
- 个人电脑变成服务器,使用ngrok将本地Web服务映射到外网
- [解决]服务器不能通过域名访问本机
- ngrok映射本地8080端口到外网
- Ngrok使用[内网服务映射到外网]
- 使用Ngrok内网服务映射到外网
- CentOS 7 搭建ngrok服务器(外网映射内网)
- 如何将ftp服务器映射为本机磁盘
- 微信公众号开发之如何将本机IP映射成外网域名
- 动态规划——《2》矩阵链乘法
- SGU132 Y
- 初次接触Promise异步编程
- unity自带测试Ping
- Jenkins部署:The username you provided is not allowed to use the text-based Tomcat Manager (error 403)
- ngrok 本机服务器映射到外网域名
- A Simple Problem with Integers
- PCL:kd-tree
- Windows 平台安装 MongoDB
- Angular(九)css类和样式1
- 浏览器兼容的一些常见bug搜集
- Stack vs. Heap: Understanding Java Memory Allocation
- OOP
- Android URL encode 空格处理