<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="blog.csbsb.eu.org/feed.xml" rel="self" type="application/atom+xml" /><link href="blog.csbsb.eu.org/" rel="alternate" type="text/html" /><updated>2026-07-31T02:36:09+00:00</updated><id>blog.csbsb.eu.org/feed.xml</id><title type="html">Billysingo</title><subtitle>for CSBSB</subtitle><entry><title type="html">tuic 搭建记录</title><link href="blog.csbsb.eu.org/tuic/" rel="alternate" type="text/html" title="tuic 搭建记录" /><published>2022-11-29T00:00:00+00:00</published><updated>2022-11-29T00:00:00+00:00</updated><id>blog.csbsb.eu.org/tuic</id><content type="html" xml:base="blog.csbsb.eu.org/tuic/"><![CDATA[<p>Surge支持了tuic，搭建一波做个记录。</p>

<h2 id="tuic-server">tuic-server</h2>

<p>项目地址 https://github.com/EAimTY/tuic</p>

<p>以 linux-amd64 为例：</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># 下载 Tuic-server
wget https://github.com/EAimTY/tuic/releases/download/0.8.5/tuic-server-0.8.5-x86_64-linux-gnu

# 重命名并放入bin目录
mv tuic-server-0.8.5-x86_64-linux-gnu tuic-server &amp;&amp; chmod +x tuic-server
cp tuic-server /usr/local/bin/
</code></pre></div></div>

<p>注意这里是0.8.5版本，以后如果有更新需要修改一下版本号。</p>

<p>添加配置文件</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo mkdir /etc/tuic &amp;&amp; vim /etc/tuic/config.json
</code></pre></div></div>

<p>填入以下配置，这里自行修改端口、密码、证书位置。如果不需要ipv6可以把IP改为0.0.0.0</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>{
    "port": 443,
    "token": ["密码"],
    "certificate": "/证书地址/fullchain.crt",
    "private_key": "/证书地址/private.key",
    "ip": "::",
    "congestion_controller": "bbr",
    "alpn": ["h3"]
}
</code></pre></div></div>

<p>接下来配置systemd服务：</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo vim /etc/systemd/system/tuic.service
</code></pre></div></div>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[Unit]
Description=Delicately-TUICed high-performance proxy built on top of the QUIC protocol.
Documentation=https://github.com/EAimTY/tuic
After=network.target

[Service]
User=root
WorkingDirectory=/usr/local/bin/
ExecStart=/usr/local/bin/tuic-server -c /etc/tuic/config.json
Restart=on-failure
RestartPreventExitStatus=1
RestartSec=5
StandardOutput=append:/var/log/tuic-server.log
StandardError=append:/var/log/tuic-server.log

[Install]
WantedBy=multi-user.target
</code></pre></div></div>

<p>然后加载服务：</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># 重载服务
sudo systemctl daemon-reload

# 开机运行 Shadow-tls
sudo systemctl enable tuic

# 开启 Shadow-tls
sudo systemctl start tuic

# 关闭 Shadow-tls
sudo systemctl stop tuic

## 查看 Shadow-tls 状态
sudo systemctl status tuic
</code></pre></div></div>

<p>tuic的运行日志会保存在/var/log/tuic-server.log</p>

<p>查看日志：</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>tail -f /var/log/tuic-server.log
</code></pre></div></div>

<h2 id="surge配置">Surge配置</h2>

<p>在[Proxy]里添加</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>tuic-test = tuic, 你的VPS域名, 443, token=your_password, alpn=h3
</code></pre></div></div>

<p>也可以直接界面里配置，非常方便。</p>

<h2 id="附注">附注</h2>

<p>如果发现运行不了提示找不到glibc版本，这是因为系统的glibc版本比较低，可以在第一步下载的时候选择musl版本</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>wget https://github.com/EAimTY/tuic/releases/download/0.8.5/tuic-server-0.8.5-x86_64-linux-musl
</code></pre></div></div>]]></content><author><name></name></author><category term="tuic" /><category term="surge" /><summary type="html"><![CDATA[Surge支持了tuic，搭建一波做个记录。 tuic-server 项目地址 https://github.com/EAimTY/tuic 以 linux-amd64 为例： # 下载 Tuic-server wget https://github.com/EAimTY/tuic/releases/download/0.8.5/tuic-server-0.8.5-x86_64-linux-gnu # 重命名并放入bin目录 mv tuic-server-0.8.5-x86_64-linux-gnu tuic-server &amp;&amp; chmod +x tuic-server cp tuic-server /usr/local/bin/ 注意这里是0.8.5版本，以后如果有更新需要修改一下版本号。 添加配置文件 sudo mkdir /etc/tuic &amp;&amp; vim /etc/tuic/config.json 填入以下配置，这里自行修改端口、密码、证书位置。如果不需要ipv6可以把IP改为0.0.0.0 { "port": 443, "token": ["密码"], "certificate": "/证书地址/fullchain.crt", "private_key": "/证书地址/private.key", "ip": "::", "congestion_controller": "bbr", "alpn": ["h3"] } 接下来配置systemd服务： sudo vim /etc/systemd/system/tuic.service [Unit] Description=Delicately-TUICed high-performance proxy built on top of the QUIC protocol. Documentation=https://github.com/EAimTY/tuic After=network.target [Service] User=root WorkingDirectory=/usr/local/bin/ ExecStart=/usr/local/bin/tuic-server -c /etc/tuic/config.json Restart=on-failure RestartPreventExitStatus=1 RestartSec=5 StandardOutput=append:/var/log/tuic-server.log StandardError=append:/var/log/tuic-server.log [Install] WantedBy=multi-user.target 然后加载服务： # 重载服务 sudo systemctl daemon-reload # 开机运行 Shadow-tls sudo systemctl enable tuic # 开启 Shadow-tls sudo systemctl start tuic # 关闭 Shadow-tls sudo systemctl stop tuic ## 查看 Shadow-tls 状态 sudo systemctl status tuic tuic的运行日志会保存在/var/log/tuic-server.log 查看日志： tail -f /var/log/tuic-server.log Surge配置 在[Proxy]里添加 tuic-test = tuic, 你的VPS域名, 443, token=your_password, alpn=h3 也可以直接界面里配置，非常方便。 附注 如果发现运行不了提示找不到glibc版本，这是因为系统的glibc版本比较低，可以在第一步下载的时候选择musl版本 wget https://github.com/EAimTY/tuic/releases/download/0.8.5/tuic-server-0.8.5-x86_64-linux-musl]]></summary></entry><entry><title type="html">Snell v4 with Shadow-tls 搭建记录</title><link href="blog.csbsb.eu.org/snell-with-shadowtls/" rel="alternate" type="text/html" title="Snell v4 with Shadow-tls 搭建记录" /><published>2022-11-14T00:00:00+00:00</published><updated>2022-11-14T00:00:00+00:00</updated><id>blog.csbsb.eu.org/snell-with-shadowtls</id><content type="html" xml:base="blog.csbsb.eu.org/snell-with-shadowtls/"><![CDATA[<p>最近Surge更新了5.20版本，添加了新协议Snellv4，添加了传输层插件Shadow-tls的支持，自己手动搭建了一下这个组合，现在做个记录。</p>

<h2 id="snell">Snell</h2>

<p>Snell比较简单，官网下载地址下载对应二进制文件即可运行。</p>

<p>https://manual.nssurge.com/others/snell.html</p>

<p>此处以 linux-amd64 为例：</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># 如果系统没有预装可能需要先下载安装 wget 及 unzip
# APT
sudo apt update &amp;&amp; sudo apt install wget unzip
# DNF
sudo dnf install unzip

# 下载 Snell Server
wget https://dl.nssurge.com/snell/snell-server-v4.0.0-linux-amd64.zip

# 解压 Snell Server 到指定目录
sudo unzip snell-server-v4.0.0-linux-amd64.zip -d /usr/local/bin
</code></pre></div></div>

<p>配置文件：</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># 可以使用 Snell 的 wizard 生成一个配置文件
sudo snell-server --wizard -c /etc/snell-server.conf
# 或者自己编写一个
sudo vim /etc/snell-server.conf
</code></pre></div></div>

<p>配置文件这里由于我们要使用shadow-tls，所以监听本地地址即可。obfs也不需要开启。</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[snell-server]
listen = 127.0.0.1:12333
psk = ScRQc0kMVaWKuIz5r41INDBkNG82CfR
ipv6 = true
obfs = false
</code></pre></div></div>
<p>配置systemd服务：</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo vim /etc/systemd/system/snell.service
</code></pre></div></div>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[Unit]
Description=Snell Proxy Service
After=network.target nss-lookup.target

[Service]
Type=simple
User=root
Group=root
LimitNOFILE=32768
ExecStart=/usr/local/bin/snell-server -c /etc/snell-server.conf
StandardOutput=append:/var/log/snell.log
StandardError=append:/var/log/snell.log
SyslogIdentifier=snell-server

[Install]
WantedBy=multi-user.target
</code></pre></div></div>

<p>然后加载服务：</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># 重载服务
sudo systemctl daemon-reload

# 开机运行 Snell
sudo systemctl enable snell

# 开启 Snell
sudo systemctl start snell

# 关闭 Snell
sudo systemctl stop snell

## 查看 Snell 状态
sudo systemctl status snell
</code></pre></div></div>

<p>snell的运行日志会保存在/var/log/snell.log</p>

<p>查看日志：</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>tail -f /var/log/snell.log
</code></pre></div></div>

<h2 id="shadow-tls">Shadow-tls</h2>

<p>接下来配置shadow-tls</p>

<p>项目地址 https://github.com/ihciah/shadow-tls</p>

<p>可采用wiki里的docker compose方式运行，我这里还是自己下载编译好的文件运行</p>

<p>依旧以 linux-amd64 为例：</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># 下载 Shadow-tls
wget https://github.com/ihciah/shadow-tls/releases/latest/download/shadow-tls-x86_64-unknown-linux-musl

# 重命名并放入bin目录
mv shadow-tls-x86_64-unknown-linux-musl shadow-tls &amp;&amp; chmod +x shadow-tls
cp shadow-tls /usr/local/bin/
</code></pre></div></div>

<p>配置systemd服务：</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo vim /etc/systemd/system/shadow-tls.service
</code></pre></div></div>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[Unit]
Description=Shadow-TLS Proxy Service
After=network.target nss-lookup.target

[Service]
Type=simple
ExecStart=/usr/local/bin/shadow-tls server --listen 0.0.0.0:443 --server 127.0.0.1:12333 --tls cloud.tencent.com:443 --password passwd
StandardOutput=append:/var/log/shadow-tls.log
StandardError=append:/var/log/shadow-tls.log
SyslogIdentifier=shadow-tls
Environment="RUST_LOG=info"

[Install]
WantedBy=multi-user.target
</code></pre></div></div>

<p>注意上面0.0.0.0:443可修改绑定的端口，127.0.0.1:12333一定要和前面snell的端口一致。此处–tls的参数和–password参数可根据自己需求修改。</p>

<p>一些推荐的–tls参数：</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cloud.tencent.com:443
icloud.apple.com:443
radio.itunes.apple.com:443
cdn-dynmedia-1.microsoft.com:443
...
</code></pre></div></div>

<p>选择域名时最好先ping一下确认延时不要太高。然后运行以下命令确认支持tls1.3</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl -I --tlsv1.3 --tls-max 1.3 -vvv https://example.com
</code></pre></div></div>

<p>然后加载服务：</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># 重载服务
sudo systemctl daemon-reload

# 开机运行 Shadow-tls
sudo systemctl enable shadow-tls

# 开启 Shadow-tls
sudo systemctl start shadow-tls

# 关闭 Shadow-tls
sudo systemctl stop shadow-tls

## 查看 Shadow-tls 状态
sudo systemctl status shadow-tls
</code></pre></div></div>

<p>Shadow-tls的运行日志会保存在/var/log/shadow-tls.log</p>

<p>查看日志：</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>tail -f /var/log/shadow-tls.log
</code></pre></div></div>

<h2 id="surge配置">Surge配置</h2>

<p>在[Proxy]里添加</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>snell-stls = snell, 你的VPS地址, 443, psk=ScRQc0kMVaWKuIz5r41INDBkNG82CfR, version=4, reuse=true, shadow-tls-password=passwd, shadow-tls-sni=cloud.tencent.com
</code></pre></div></div>

<p>注意端口为shadow-tls监听的端口。目前版本shadow-tls相关配置只能在文本编辑里配置。</p>]]></content><author><name></name></author><category term="snell" /><category term="shadow-tls" /><category term="surge" /><summary type="html"><![CDATA[最近Surge更新了5.20版本，添加了新协议Snellv4，添加了传输层插件Shadow-tls的支持，自己手动搭建了一下这个组合，现在做个记录。 Snell Snell比较简单，官网下载地址下载对应二进制文件即可运行。 https://manual.nssurge.com/others/snell.html 此处以 linux-amd64 为例： # 如果系统没有预装可能需要先下载安装 wget 及 unzip # APT sudo apt update &amp;&amp; sudo apt install wget unzip # DNF sudo dnf install unzip # 下载 Snell Server wget https://dl.nssurge.com/snell/snell-server-v4.0.0-linux-amd64.zip # 解压 Snell Server 到指定目录 sudo unzip snell-server-v4.0.0-linux-amd64.zip -d /usr/local/bin 配置文件： # 可以使用 Snell 的 wizard 生成一个配置文件 sudo snell-server --wizard -c /etc/snell-server.conf # 或者自己编写一个 sudo vim /etc/snell-server.conf 配置文件这里由于我们要使用shadow-tls，所以监听本地地址即可。obfs也不需要开启。 [snell-server] listen = 127.0.0.1:12333 psk = ScRQc0kMVaWKuIz5r41INDBkNG82CfR ipv6 = true obfs = false 配置systemd服务： sudo vim /etc/systemd/system/snell.service [Unit] Description=Snell Proxy Service After=network.target nss-lookup.target [Service] Type=simple User=root Group=root LimitNOFILE=32768 ExecStart=/usr/local/bin/snell-server -c /etc/snell-server.conf StandardOutput=append:/var/log/snell.log StandardError=append:/var/log/snell.log SyslogIdentifier=snell-server [Install] WantedBy=multi-user.target 然后加载服务： # 重载服务 sudo systemctl daemon-reload # 开机运行 Snell sudo systemctl enable snell # 开启 Snell sudo systemctl start snell # 关闭 Snell sudo systemctl stop snell ## 查看 Snell 状态 sudo systemctl status snell snell的运行日志会保存在/var/log/snell.log 查看日志： tail -f /var/log/snell.log Shadow-tls 接下来配置shadow-tls 项目地址 https://github.com/ihciah/shadow-tls 可采用wiki里的docker compose方式运行，我这里还是自己下载编译好的文件运行 依旧以 linux-amd64 为例： # 下载 Shadow-tls wget https://github.com/ihciah/shadow-tls/releases/latest/download/shadow-tls-x86_64-unknown-linux-musl # 重命名并放入bin目录 mv shadow-tls-x86_64-unknown-linux-musl shadow-tls &amp;&amp; chmod +x shadow-tls cp shadow-tls /usr/local/bin/ 配置systemd服务： sudo vim /etc/systemd/system/shadow-tls.service [Unit] Description=Shadow-TLS Proxy Service After=network.target nss-lookup.target [Service] Type=simple ExecStart=/usr/local/bin/shadow-tls server --listen 0.0.0.0:443 --server 127.0.0.1:12333 --tls cloud.tencent.com:443 --password passwd StandardOutput=append:/var/log/shadow-tls.log StandardError=append:/var/log/shadow-tls.log SyslogIdentifier=shadow-tls Environment="RUST_LOG=info" [Install] WantedBy=multi-user.target 注意上面0.0.0.0:443可修改绑定的端口，127.0.0.1:12333一定要和前面snell的端口一致。此处–tls的参数和–password参数可根据自己需求修改。 一些推荐的–tls参数： cloud.tencent.com:443 icloud.apple.com:443 radio.itunes.apple.com:443 cdn-dynmedia-1.microsoft.com:443 ... 选择域名时最好先ping一下确认延时不要太高。然后运行以下命令确认支持tls1.3 curl -I --tlsv1.3 --tls-max 1.3 -vvv https://example.com 然后加载服务： # 重载服务 sudo systemctl daemon-reload # 开机运行 Shadow-tls sudo systemctl enable shadow-tls # 开启 Shadow-tls sudo systemctl start shadow-tls # 关闭 Shadow-tls sudo systemctl stop shadow-tls ## 查看 Shadow-tls 状态 sudo systemctl status shadow-tls Shadow-tls的运行日志会保存在/var/log/shadow-tls.log 查看日志： tail -f /var/log/shadow-tls.log Surge配置 在[Proxy]里添加 snell-stls = snell, 你的VPS地址, 443, psk=ScRQc0kMVaWKuIz5r41INDBkNG82CfR, version=4, reuse=true, shadow-tls-password=passwd, shadow-tls-sni=cloud.tencent.com 注意端口为shadow-tls监听的端口。目前版本shadow-tls相关配置只能在文本编辑里配置。]]></summary></entry></feed>