Hysteria 2 安装指南
cp -f /root/hy2/build/hysteria-linux-amd64 /root/hysteria && chmod +x /root/hysteria
cp -f /root/hy2/build/hysteria-windows-amd64.exe /root/hysteria.exe
- 下载配置
curl -Lo /root/hysteria_config.yaml https://raw.githubusercontent.com/chika0801/hysteria-install/main/Hysteria_2_config_server.yaml
- 下载systemctl配置
curl -Lo /etc/systemd/system/hysteria.service https://raw.githubusercontent.com/chika0801/hysteria-install/main/Hysteria_2_hysteria.service && systemctl daemon-reload
- 上传证书和私钥
- 将证书文件改名为 fullchain.cer,将私钥文件改名为 private.key,将它们上传到 /root 目录
- 启动程序
systemctl enable --now hysteria && sleep 0.2 && systemctl status hysteria
项目 | |
---|---|
程序 | /root/hysteria |
配置 | /root/hysteria_config.yaml |
查看日志 | journalctl -u hysteria --output cat -e |
实时日志 | journalctl -u hysteria --output cat -f |
systemctl disable --now hysteria && rm /root/hysteria && rm /root/hysteria_config.yaml && rm /etc/systemd/system/hysteria.service
-
下载自己编译的Windows客户端程序hysteria-windows-amd64.exe,重命名为hysteria.exe,复制到v2rayN\bin\hysteria文件夹。
-
下载客户端配置Hysteria_2_config_client.yaml,修改chika.example.com为证书中包含的域名,修改10.0.0.1为VPS的IP。
-
服务器 ——> 添加自定义配置服务器 ——> 浏览 ——> 选择客户端配置 ——> Core类型 hysteria ——> Socks端口 50000
- sing-box:参考 sing-box Windows 客户端使用方法,将 sing-box Windows 客户端配置 进行如下修改。
原内容
{
"tag": "proxy",
// 粘贴你的客户端配置,需要保留 "tag": "proxy",
},
替换为
{
"type": "socks",
"tag": "proxy",
"server": "127.0.0.1",
"server_port": 50000
},
- v2rayN:参考 由 v2rayN 提供 http/socks5 代理。服务器 ——> 添加自定义配置服务器 ——> 浏览 ——> 选择客户端配置 ——> Core类型 tuic ——> Socks端口 0。
Hysteria 安装指南
- 下载程序(linux-amd64)
curl -Lo /root/hysteria https://github.com/apernet/hysteria/releases/latest/download/hysteria-linux-amd64 && chmod +x /root/hysteria
- 下载配置
curl -Lo /root/hysteria_config.json https://raw.githubusercontent.com/chika0801/hysteria-install/main/config_server.json
- 下载systemctl配置
curl -Lo /etc/systemd/system/hysteria.service https://raw.githubusercontent.com/chika0801/hysteria-install/main/hysteria.service && systemctl daemon-reload
- 上传证书和私钥
- 将证书文件改名为 fullchain.cer,将私钥文件改名为 private.key,将它们上传到 /root 目录
点击查看详细步骤
安装
apt install -y iptables-persistent
添加
iptables -t nat -A PREROUTING -i eth0 -p udp --dport 16387:16485 -j DNAT --to-destination :16385
netfilter-persistent save
查看
iptables -t nat -nL --line
删除
iptables -t nat -D PREROUTING 1
netfilter-persistent save
- 启动程序
systemctl enable --now hysteria && sleep 0.2 && systemctl status hysteria
项目 | |
---|---|
程序 | /root/hysteria |
配置 | /root/hysteria_config.json |
查看日志 | journalctl -u hysteria --output cat -e |
实时日志 | journalctl -u hysteria --output cat -f |
点击查看
-
下载Windows客户端程序hysteria-windows-amd64.exe,重命名为hysteria.exe,复制到v2rayN\bin\hysteria文件夹。
-
下载客户端配置config_client.json,修改chika.example.com为证书中包含的域名,修改10.0.0.1为VPS的IP。
-
服务器 ——> 添加自定义配置服务器 ——> 浏览 ——> 选择客户端配置 ——> Core类型 hysteria ——> Socks端口 50000
小技巧:只要证书在有效期内,证书中包含的域名不用解析到VPS的IP。一份证书,在多个VPS上使用。
点击查看
选项 | 值 |
---|---|
类型 | Hysteria |
地址 | VPS的IP |
端口 | 16385,16387-16485 |
密码 | chika |
混淆 | 留空 |
协议 | UDP |
允许不安全 | 不选 |
UDP 转发 | 选上 |
快速打开 | 选上 |
SNI | 证书中包含的域名 |
ALPN | h3 |
上行速度 | 20 |
下行速度 | 100 |
点击查看
选项 | 值 | 对应参数 |
---|---|---|
类型 | Hysteria | |
地址(支持域名) | VPS的IP | "server" |
端口 | 16385 | "server" |
端口跳跃额外端口 | 16387-16485 | "server" |
协议 | UDP | "protocol" |
混淆密码 | 留空 | "obfs" |
认证类型 | STRING | |
认证密码 | chika | "auth_str" |
QUIC TLS ALPN | h3 | "alpn" |
快速打开 | 勾上 | "fast_open" |
域名 | 证书中包含的域名 | "server_name" |
允许不安全连接 | 不勾 | "insecure" |
最大上行(Mbps) | 50 | "up_mbps" |
最大下行(Mbps) | 150 | "down_mbps" |
QUIC 流接收窗口 | 6710886 | "recv_window_conn" |
QUIC 连接接收窗口 | 16777216 | "recv_window" |
握手超时 | 留空 | "handshake_timeout" |
空闲超时 | 留空 | "idle_timeout" |
端口跳跃时间 | 留空 | "hop_interval" |
禁用 MTU 检测 | 不勾 | "disable_mtu_discovery" |
点击查看
选项 | 值 | 对应参数 |
---|---|---|
服务器节点类型 | Hysteria | |
服务器地址 | VPS的IP | "server" |
端口 | 16385 | "server" |
协议 | udp | "protocol" |
验证类型 | string | |
验证载荷 | chika | "auth_str" |
QUIC 连接接收窗口 | 16777216 | "recv_window" |
QUIC 流接收窗口 | 6710886 | "recv_window_conn" |
禁用 MTU 探测 | 不勾 | "disable_mtu_discovery" |
延迟启动 | 不勾 | "lazy_start" |
上行链路容量 | 50 | "up_mbps" |
下行链路容量 | 150 | "down_mbps" |
混淆密码(可选) | 留空 | "obfs" |
TLS 主机名 | 证书中包含的域名 | "server_name" |
QUIC TLS ALPN | h3 | "alpn" |
允许不安全连接 | 不勾 | "insecure" |
自签证书 | 不勾 | |
TCP 快速打开 | 勾上 | "fast_open" |
启用自动切换 | 不勾 | |
本地端口 | 1234 |