<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>内网穿透 &#8211; from0to1</title>
	<atom:link href="https://www.from0to1.top/tag/%E5%86%85%E7%BD%91%E7%A9%BF%E9%80%8F/feed" rel="self" type="application/rss+xml" />
	<link>https://www.from0to1.top</link>
	<description>一个研究技术、分享经验的博客</description>
	<lastBuildDate>Sun, 01 Oct 2023 17:10:48 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.2</generator>
	<item>
		<title>搭建内网穿透</title>
		<link>https://www.from0to1.top/168.html</link>
					<comments>https://www.from0to1.top/168.html#respond</comments>
		
		<dc:creator><![CDATA[captain]]></dc:creator>
		<pubDate>Thu, 21 Sep 2023 09:42:05 +0000</pubDate>
				<category><![CDATA[服务器]]></category>
		<category><![CDATA[内网穿透]]></category>
		<category><![CDATA[网站]]></category>
		<guid isPermaLink="false">https://www.from0to1.top/?p=168</guid>

					<description><![CDATA[前言 如果你不会搭建，可以购买人工服务，操作人员将会于24小时内帮你搭建完成，价格为40（这时间和价格比起来感觉是当黑奴了&#8230;），请点击前往或滚动到最下方购买 搭建网站这么久，我用过不少内网穿透，飞鸽、ngrok、openfrp、樱花、乐青等等，他们都有或多或少的问题，价格太贵或是节点访问慢、不稳定，导致我最后放弃了使用它们，决定自己搭一个内网穿透 (这篇文章不想写太细，不会像教你搭建网 [&#8230;]]]></description>
										<content:encoded><![CDATA[<h1 style="text-align: center;">前言</h1>
<h2 class="h-title"><span style="color: #ff0000;">如果你不会搭建，可以购买人工服务，操作人员将会于24小时内帮你搭建完成，价格为40（这时间和价格比起来感觉是当黑奴了&#8230;），请<a class="links_btn" href="#get" target="_blank" rel="noopener">点击前往</a>或滚动到最下方购买</span></h2>
<p>搭建网站这么久，我用过不少内网穿透，飞鸽、ngrok、openfrp、樱花、乐青等等，他们都有或多或少的问题，价格太贵或是节点访问慢、不稳定，导致我最后放弃了使用它们，决定自己搭一个内网穿透 <span style="color: #ff0000;"><strong>(这篇文章不想写太细，不会像<a class="links_btn" href="https://www.from0to1.top/7.html" target="_blank" rel="noopener">教你搭建网站</a>那样每个步骤和代码都给你，完全不懂的小白还是老老实实用别人做的吧或选择付费搭建服务)</strong></span>我先尝试了著名的frp，发现和openfrp差距的有点大，特别是没有自动https，我可不想每个web服务器都写跳转规则，心烦时在GitHub上找到了长亭雷池 WAF<a class="links_btn" href="https://github.com/chaitin/safeline" target="_blank" rel="noopener">GitHub链接</a>和rathole<a class="links_btn" href="https://github.com/rapiz1/rathole" target="_blank" rel="noopener">GitHub链接</a>在不断的尝试下我发现长亭雷池 WAF可以和rathole配合，完美解决自动https (frp做不到，被自定义域名限制住了) 接下来开始教学</p>
<h2 class="h-title">1、购买云服务器</h2>
<p>内网穿透你需要一台有公网IP的服务器，我使用的是阿里云的轻量应用服务器，配置香港2核2G每月2TB流量峰值带宽30mbps每月34RMB，内网穿透的同时能加一个WAF，这个价格也就可以接受了<strong> (使用其他内网穿透我每月最少要花26，访问要十几秒、nas下载只有三百多kb根本用不了）</strong>去阿里云搜索 轻量应用服务器，地区香港 <strong>不然要备案，带宽还只有5mbps</strong> <span style="color: #ff0000;"><strong>(吐槽一下: 备案机制真的挺恶心的,<span style="color: #3366ff;">听说</span>2024年3月连app都要备案了，不备案禁止联网，连国外都不让看？GitHub、dockerhub、youtube等等你还怎么用？)</strong></span>机器配置按你自己需求，1G内存装不了WAF，只能搭frp。（你也可以直接把网站迁移到云服务器上）</p>
<h2 class="h-title">2、安装内网穿透</h2>
<p>点击链接前往<a class="links_btn" href="https://github.com/rapiz1/rathole/" target="_blank" rel="noopener">rathole</a>Github项目地址，网页右边Releases下载符合你服务器系统的压缩包，解压可以得到可运行的程序，启动和命令什么的就不讲了，项目文档上一堆，<span style="color: #ff0000;">（<strong>测试时别忘了阿里云的防火墙要打开）</strong></span><br />
<img decoding="async" src="https://www.from0to1.top/wp-content/uploads/2023/09/Ink130905.jpg" alt="下载" /><br />
这个是<span style="color: #ff0000;"><strong>服务端</strong></span>的开机自启，<span style="color: #ff0000;"><strong>别忘了改成你自己的文件所在位置,使用方法自己搜索</strong></span><a class="links_btn" href="https://github.com/rapiz1/rathole/blob/main/examples/systemd/ratholes.service" target="_blank" rel="noopener">服务端开机自启</a></p>
<pre class="prettyprint linenums">[Unit]
Description=Rathole Server Service
After=network.target

[Service]
Type=simple
Restart=on-failure
RestartSec=5s
LimitNOFILE=1048576

# with root
ExecStart=/usr/bin/rathole -s /etc/rathole/rathole.toml
# without root
# ExecStart=%h/.local/bin/rathole -s %h/.local/etc/rathole/rathole.toml

[Install]
WantedBy=multi-user.target</pre>
<p>这个是客户端的开机自启，<span style="color: #ff0000;"><strong>别忘了改成你自己的文件所在位置,使用方法自己搜索</strong></span><a class="links_btn" href="https://github.com/rapiz1/rathole/blob/main/examples/systemd/ratholec.service" target="_blank" rel="noopener">客户端开机自启</a></p>
<pre class="prettyprint linenums">[Unit]
Description=Rathole Client Service
After=network.target

[Service]
Type=simple
Restart=on-failure
RestartSec=5s
LimitNOFILE=1048576

# with root
ExecStart=/usr/bin/rathole -c /etc/rathole/rathole.toml
# without root
# ExecStart=%h/.local/bin/rathole -c %h/.local/etc/rathole/rathole.toml

[Install]
WantedBy=multi-user.target</pre>
<h2 id="get" class="h-title">3、安装雷池WAF</h2>
<p>这是官网的一键安装脚本，<span style="color: #ff0000;">安装依赖docker和docker compose</span>（docker一键安装脚本<code>curl -fsSL https://get.docker.com | bash -s docker</code>）</p>
<pre class="prettyprint linenums">bash -c &quot;$(curl -fsSLk https://waf-ce.chaitin.cn/release/latest/setup.sh)&quot;</pre>
<p><span style="color: #ff0000;"><strong>具体安装看官方文档</strong></span><a class="links_btn" href="https://waf-ce.chaitin.cn/" target="_blank" rel="noopener">雷池WAF官网</a><br />
<strong>rathole穿透后的端口，阿里云防火墙策略设置为只允许127.0.0.1访问，然后用雷池反向代理过去就行了，上游服务器地址填http://127.0.0.1 <span style="color: #ff0000;">协议自定，端口填你穿透后的端口</span></strong></p>
<h2 class="h-title"><span style="color: #ff0000;">如果你不会搭建，可以购买人工服务，操作人员将会于24小时内帮你搭建完成，价格为40（这时间和价格比起来感觉是当黑奴了&#8230;），请<a class="links_btn" href="#get" target="_blank" rel="noopener">点击前往</a>或滚动到最下方购买</span></h2>
<div class="erphpdown erphpdown-see erphpdown-see-pay erphpdown-content-vip" id="erphpdown" style="display:block;">此内容查看价格为<span class="erphpdown-price">40</span>加隆，请先<a href="https://www.from0to1.top/login" target="_blank" class="erphp-login-must">登录</a><div class="erphpdown-tips">在本站充值消费一律不支持退款，请理性选择！</div></div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.from0to1.top/168.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
