<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://gentoo-zh.org/extern.php?action=feed&amp;tid=562&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Gentoo中文社区 / cf+v2]]></title>
		<link>http://www.gentoo-zh.org/viewtopic.php?id=562</link>
		<description><![CDATA[cf+v2 最近发表的帖子。]]></description>
		<lastBuildDate>Wed, 27 Aug 2025 11:42:26 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: cf+v2]]></title>
			<link>http://www.gentoo-zh.org/viewtopic.php?pid=1006#p1006</link>
			<description><![CDATA[<p>嗯嗯嗯！测试几下就明白了</p>]]></description>
			<author><![CDATA[dummy@example.com (batsom)]]></author>
			<pubDate>Wed, 27 Aug 2025 11:42:26 +0000</pubDate>
			<guid>http://www.gentoo-zh.org/viewtopic.php?pid=1006#p1006</guid>
		</item>
		<item>
			<title><![CDATA[Re: cf+v2]]></title>
			<link>http://www.gentoo-zh.org/viewtopic.php?pid=1005#p1005</link>
			<description><![CDATA[<p>好好研究一下！</p>]]></description>
			<author><![CDATA[dummy@example.com (ＴＭＤ)]]></author>
			<pubDate>Tue, 26 Aug 2025 16:10:17 +0000</pubDate>
			<guid>http://www.gentoo-zh.org/viewtopic.php?pid=1005#p1005</guid>
		</item>
		<item>
			<title><![CDATA[cf+v2]]></title>
			<link>http://www.gentoo-zh.org/viewtopic.php?pid=599#p599</link>
			<description><![CDATA[<p>yum -y install wget zip unzip vim </p><p>curl -Ls <a href="https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh" rel="nofollow">https://raw.githubusercontent.com/v2fly … release.sh</a> | bash</p><p>脚本会自动安装这些东西：</p><p>&#160; &#160; /usr/bin/v2ray/v2ray V2Ray 程序<br />&#160; &#160; /usr/bin/v2ray/v2ctl V2Ray 工具<br />&#160; &#160; /etc/v2ray/config.json 配置文件<br />&#160; &#160; /usr/bin/v2ray/geoip.dat IP 数据文件<br />&#160; &#160; /usr/bin/v2ray/geosite.dat 域名数据文件<br />&#160; &#160; /etc/systemd/system/v2ray.service Systemd Service<br />&#160; &#160; /etc/init.d/v2ray SysV 启动脚本</p><p>cat /proc/sys/kernel/random/uuid <br />1cf3afc3-9342-4215-85ca-64fba7d6d8ba</p><p>vim /usr/local/etc/v2ray/config.json</p><p>{<br />&#160; &quot;inbounds&quot;: [{<br />&#160; &#160; &quot;port&quot;: 61000,<br />&#160; &#160; // 因为还要用 Nginx 反代，这里直接监听本地就行<br />&#160; &#160; &quot;listen&quot;: &quot;127.0.0.1&quot;,<br />&#160; &#160; &quot;protocol&quot;: &quot;vmess&quot;,<br />&#160; &#160; &quot;settings&quot;: {<br />&#160; &#160; &#160; &quot;clients&quot;: [<br />&#160; &#160; &#160; &#160; {<br />&#160; &#160; &#160; &#160; &#160; // 用户 UUID，自己随机弄一个<br />&#160; &#160; &#160; &#160; &#160; &quot;id&quot;: &quot;1cf3afc3-9342-4215-85ca-64fba7d6d8ba&quot;,<br />&#160; &#160; &#160; &#160; &#160; &quot;level&quot;: 1,<br />&#160; &#160; &#160; &#160; &#160; &quot;alterId&quot;: 64<br />&#160; &#160; &#160; &#160; }<br />&#160; &#160; &#160; ]<br />&#160; &#160; },<br />&#160; &#160; &quot;streamSettings&quot;: {<br />&#160; &#160; &#160; // 指定底层传输方式为 WebSocket<br />&#160; &#160; &#160; &quot;network&quot;: &quot;ws&quot;,<br />&#160; &#160; &#160; &quot;wsSettings&quot;: {<br />&#160; &#160; &#160; &#160; // 在哪个路径上提供 WS 服务，可自定义<br />&#160; &#160; &#160; &#160; &quot;path&quot;: &quot;/video&quot;<br />&#160; &#160; &#160; }<br />&#160; &#160; }<br />&#160; }],<br />&#160; &quot;outbounds&quot;: [{<br />&#160; &#160; &quot;protocol&quot;: &quot;freedom&quot;,<br />&#160; &#160; &quot;settings&quot;: {}<br />&#160; },{<br />&#160; &#160; &quot;protocol&quot;: &quot;blackhole&quot;,<br />&#160; &#160; &quot;settings&quot;: {},<br />&#160; &#160; &quot;tag&quot;: &quot;blocked&quot;<br />&#160; }],<br />&#160; &quot;routing&quot;: {<br />&#160; &#160; &quot;rules&quot;: [<br />&#160; &#160; &#160; {<br />&#160; &#160; &#160; &#160; // 默认规则，禁止访问服务器内网<br />&#160; &#160; &#160; &#160; &quot;type&quot;: &quot;field&quot;,<br />&#160; &#160; &#160; &#160; &quot;ip&quot;: [&quot;geoip:private&quot;],<br />&#160; &#160; &#160; &#160; &quot;outboundTag&quot;: &quot;blocked&quot;<br />&#160; &#160; &#160; }<br />&#160; &#160; ]<br />&#160; }<br />}</p><p>3. 运行 V2Ray</p><p>配置完了，运行一下：</p><p>systemctl start v2ray</p><p>如果你的服务器不用 Systemd：</p><p>service v2ray start<br /># 要么<br />/etc/init.d/v2ray start<br /># 或者手动运行<br />/usr/local/bin/v2ray -config /usr/local/etc/v2ray/config.json</p><p>curl -i <a href="http://127.0.0.1:61000/video" rel="nofollow">http://127.0.0.1:61000/video</a></p><p>注意 curl 访问的端口和路径要和上面 V2Ray 中配置的一致，出现 400 Bad Request 就对了。</p><br /><p>配置 Nginx (安装lnmp)<br />开启ipv6</p><p>以 Nginx 为例，找个合适的 server {} 块添加以下内容（这重定向语法够蛋疼的）：</p><p>&#160; &#160; &#160; &#160; listen 443 ssl;<br />&#160; &#160; &#160; &#160; server_name oracle.6465.xyz;<br />&#160; &#160; &#160; &#160; ssl_certificate /usr/local/nginx/ssl/oracle.64659886.xyz/oracle.64659886.xyz.cer;<br />&#160; &#160; &#160; &#160; ssl_certificate_key /usr/local/nginx/ssl/oracle.64659886.xyz/oracle.64659886.xyz.key;<br />&#160; &#160; &#160; &#160; ssl_session_timeout 5m;</p><br /><p>location /video {<br />&#160; &#160; proxy_redirect off;<br />&#160; &#160; proxy_http_version 1.1;<br />&#160; &#160; proxy_set_header Upgrade $http_upgrade;<br />&#160; &#160; proxy_set_header Connection &quot;upgrade&quot;;<br />&#160; &#160; proxy_set_header Host $http_host;<br />&#160; &#160; proxy_set_header X-Real-IP $remote_addr;<br />&#160; &#160; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;</p><p>&#160; &#160; set $is_v2ray 0;<br />&#160; &#160; if ($http_upgrade = &quot;websocket&quot;) {<br />&#160; &#160; &#160; &#160; set $is_v2ray 1;<br />&#160; &#160; }</p><p>&#160; &#160; if ($is_v2ray = 1) {<br />&#160; &#160; &#160; &#160; # 仅当请求为 WebSocket 时才反代到 V2Ray<br />&#160; &#160; &#160; &#160; proxy_pass <a href="http://127.0.0.1:61000" rel="nofollow">http://127.0.0.1:61000</a>;<br />&#160; &#160; }</p><p>&#160; &#160; if ($is_v2ray = 0) {<br />&#160; &#160; &#160; &#160; # 否则显示正常网页<br />&#160; &#160; &#160; &#160; rewrite ^/(.*)$ /mask-page last;<br />&#160; &#160; }<br />}</p><p>curl -i <a href="https://v2.6465.xyz/video" rel="nofollow">https://v2.6465.xyz/video</a> (404无法访问)<br />wscat -c <a href="https://v2.6465.xyz/video" rel="nofollow">https://v2.6465.xyz/video</a> (命令不存在)</p><br /><p>config.json内容:</p>]]></description>
			<author><![CDATA[dummy@example.com (batsom)]]></author>
			<pubDate>Sun, 13 Nov 2022 10:18:11 +0000</pubDate>
			<guid>http://www.gentoo-zh.org/viewtopic.php?pid=599#p599</guid>
		</item>
	</channel>
</rss>
