原创文|Space9
本地网站开发
准备好一个本地可以运行的网站,正确部署完成。

外网访问本地网站
实现外网访问,我们需要利用Oray花生壳软件进行内网穿透。

首先,进行账号注册,验证码支持手机和邮箱两种方式。

下载花生壳客户端。

安装好之后,运行登录。


点击内网穿透,申请开通体验版,需要支付6元费用。

在内网穿透网页,添加映射。

填写映射配置信息,应用名称自定义,映射类型选择HTTP80,内网主机填写本地IP,端口填写本地网站的端口。

点击我的域名,可以看到免费给分配的一个域名,只不过域名过长不容易识别,下文会教大家设置一个自定义域名。

现在,浏览器尝试访问那个分配的域名,可以成功看到本地网站。

自定义域名
自定义域名需要借助码云的Gitee Pages服务
首先,注册码云账号,个性域名填入你要自定义的域名(MySite9)。

注册成功后,需要建立一个与自己个性域名同名的项目(MySite9)。
新建项目完成后,添加文件 index.html (注意名称是index.html哦!)
点击新建文件,文件名输入index.html,内容复制以下代码。
<html>
<head>
<script>
window.location.replace("上文中花生壳免费域名")
</script>
</head>
</html>
点击提交,将文件提交到仓库
最后,选择Gitee Pages服务并启动。

这样我们就可以通过自定义域名访问自己的网站啦!(https://MySite9.gitee.io)

上一篇:Soul瞬间发布长录音教程
本文仅为个人学习使用,不得用于任何商业用途,否则后果自负!如侵犯到您的权益,请及时通知我,我会及时处理。
网友评论