手动搭建 Hysteria2 协议用于Surge/Loon-整点猫咪

同步来源:树洞剪藏 源站剪藏 ID:644 原文地址:https://surge.tel/21/2816/
手动搭建 Hysteria2 协议用于Surge/Loon-整点猫咪
set 限制解除
整点资源
整点教程
整点心情
登录
注册
找回密码
首页
整点教程 正文
手动搭建 Hysteria2 协议用于Surge/Loon
整点猫咪 3年前更新 关注
1 1.4W+ 19
Life, there will always be the unexpected warmth and the endless hope. 人生,总会有不期而遇的温暖,和生生不息的希望
手动搭建 Hysteria2 协议用于Surge/Loon
沉寂了很久的老刘,在今天surge的TF版Surge 5 5.21.0 (2875)给大家带来了最新的订阅项目Hysteria2协议的支持。
2023年10月29日更新:Loon在TF版3.1.3(629)中也增加了对hysteria2协议的支持。
关于
Hysteria是底层传输基于udp的加密代理协议,对比目前使用的ss、vmess、vless、trojan等协议,Hysteria在绕过防火墙审查的同时还能大幅提升上网速度,这是因为Hysteria修改了quic的拥塞控制算法。最近Hysteria2更新到了2.0版本,大幅提升了性能和稳定性,支持反代伪装,增加抗审查能力。
需要准备的(acme方式)
一台VPS(支持UDP)
一个域名
将域名解析到VPS的IP
后文有没有域名自签证书的方式(注意ACME和自签证书二选一)
开始
安装服务端
官方已经准备好了一键
bash <(curl -fsSL https://get.hy2.sh/ )
安装好后如下图:
如果英语水平不是那么差的话应该能够读懂
接下来先配置服务端
说明一下,默认监听的是443端口,可以根据自己需要改成其它端口
根据你的喜好使用vim或者nano 修改 /etc/hysteria/config.yaml 文件
listen: : 443 //默认监听443,可换成其它端口
acme:
domains:
- www. yourdomain . com //你的域名
email: your@email. com //你的邮箱
auth:
type: password
password: yourpassword //你的密码
masquerade:
type: proxy
proxy:
url: https ://www.bing.com/ //想伪装的sni
rewriteHost: true
quic:
initStreamReceiveWindow: 26843545
maxStreamReceiveWindow: 26843545
initConnReceiveWindow: 67108864
maxConnReceiveWindow: 67108864 listen: :443 //默认监听443,可换成其它端口
acme: domains:
- www.yourdomain.com //你的域名 email: [email protected] //你的邮箱
auth: type: password password: yourpassword //你的密码
masquerade: type: proxy proxy: url: https://www.bing.com/ //想伪装的sni rewriteHost: true quic: initStreamReceiveWindow: 26843545 maxStreamReceiveWindow: 26843545 initConnReceiveWindow: 67108864 maxConnReceiveWindow: 67108864 listen: :443 //默认监听443,可换成其它端口
acme: domains:
- www.yourdomain.com //你的域名 email: [email protected] //你的邮箱
auth: type: password password: yourpassword //你的密码
masquerade: type: proxy proxy: url: https://www.bing.com/ //想伪装的sni rewriteHost: true quic: initStreamReceiveWindow: 26843545 maxStreamReceiveWindow: 26843545 initConnReceiveWindow: 67108864 maxConnReceiveWindow: 67108864
或者也可以直接对下面的代码进行修改后复制进去使用:
cat << EOF > /etc/hysteria/config. yaml
listen: : 443
acme:
domains:
- xxx. com #把xxx.com改成你的域名,需要先解析到服务器ip
email: test@sharklasers. com #可以改成自己邮箱,也可以把test这里随便加几个字符
auth:
type: password
password: 123456 #设置密码
masquerade:
type: proxy
proxy:
url: https ://bing.com #伪装网址
rewriteHost: true
quic:
initStreamReceiveWindow: 26843545
maxStreamReceiveWindow: 26843545
initConnReceiveWindow: 67108864
maxConnReceiveWindow: 67108864
EOF cat < /etc/hysteria/config.yaml listen: :443
acme: domains:
- xxx.com #把xxx.com改成你的域名,需要先解析到服务器ip email: [email protected] #可以改成自己邮箱,也可以把test这里随便加几个字符
auth: type: password password: 123456 #设置密码
masquerade: type: proxy proxy: url: https://bing.com #伪装网址 rewriteHost: true quic: initStreamReceiveWindow: 26843545 maxStreamReceiveWindow: 26843545 initConnReceiveWindow: 67108864 maxConnReceiveWindow: 67108864 EOF cat < /etc/hysteria/config.yaml listen: :443
acme: domains:
- xxx.com #把xxx.com改成你的域名,需要先解析到服务器ip email: [email protected] #可以改成自己邮箱,也可以把test这里随便加几个字符
auth: type: password password: 123456 #设置密码
masquerade: type: proxy proxy: url: https://bing.com #伪装网址 rewriteHost: true quic: initStreamReceiveWindow: 26843545 maxStreamReceiveWindow: 26843545 initConnReceiveWindow: 67108864 maxConnReceiveWindow: 67108864 EOF
自签证书方法
生成自签证书
openssl req -x509 -nodes -newkey ec: <( openssl ecparam -name prime256v1 ) -keyout /etc/hysteria/server. key -out /etc/hysteria/server. crt -subj "/CN=bing.com" -days 36500 && sudo chown hysteria /etc/hysteria/server. key && sudo chown hysteria /etc/hysteria/server. crt openssl req -x509 -nodes -newkey ec:<(openssl ecparam -name prime256v1) -keyout /etc/hysteria/server.key -out /etc/hysteria/server.crt -subj "/CN=bing.com" -days 36500 && sudo chown hysteria /etc/hysteria/server.key && sudo chown hysteria /etc/hysteria/server.crt openssl req -x509 -nodes -newkey ec:<(openssl ecparam -name prime256v1) -keyout /etc/hysteria/server.key -out /etc/hysteria/server.crt -subj "/CN=bing.com" -days 36500 && sudo chown hysteria /etc/hysteria/server.key && sudo chown hysteria /etc/hysteria/server.crt
服务端配置文件:
对下面的代码进行修改后复制进去使用
cat << EOF > /etc/hysteria/config. yaml
listen: : 443 #监听端口
tls:
cert: /etc/hysteria/server. crt
key: /etc/hysteria/server. key
auth:
type: password
password: 123456 #设置认证密码
masquerade:
type: proxy
proxy:
url: https ://bing.com #伪装网址
rewriteHost: true
quic:
initStreamReceiveWindow: 26843545
maxStreamReceiveWindow: 26843545
initConnReceiveWindow: 67108864
maxConnReceiveWindow: 67108864
EOF cat << EOF > /etc/hysteria/config.yaml listen: :443 #监听端口 tls: cert: /etc/hysteria/server.crt key: /etc/hysteria/server.key
auth: type: password password: 123456 #设置认证密码
masquerade: type: proxy proxy: url: https://bing.com #伪装网址 rewriteHost: true quic: initStreamReceiveWindow: 26843545 maxStreamReceiveWindow: 26843545 initConnReceiveWindow: 67108864 maxConnReceiveWindow: 67108864 EOF cat << EOF > /etc/hysteria/config.yaml listen: :443 #监听端口 tls: cert: /etc/hysteria/server.crt key: /etc/hysteria/server.key
auth: type: password password: 123456 #设置认证密码
masquerade: type: proxy proxy: url: https://bing.com #伪装网址 rewriteHost: true quic: initStreamReceiveWindow: 26843545 maxStreamReceiveWindow: 26843545 initConnReceiveWindow: 67108864 maxConnReceiveWindow: 67108864 EOF
配置好服务端后,即可启动服务端:
systemctl start hysteria-server. service systemctl start hysteria-server.service systemctl start hysteria-server.service
将服务端设置成开机自动启动
systemctl enable hysteria-server. service systemctl enable hysteria-server.service systemctl enable hysteria-server.service
查看服务端状态:
systemctl status hysteria-server. service systemctl status hysteria-server.service systemctl status hysteria-server.service
上图是运行后第一次查看服务端状态时候的一些日志,可以看到有证书的一个申请配置过程。
正常时候一般就是下图这样的:
至此hy2就已经搭建完成了
在surge上使用:
通过文本模式进行编辑,配置的格式如下:
如果采用自签证书方法,在配置文件中加入 skip-cert-verify=true
Proxy = hysteria2, 192.168 . 20 . 62 , 443 , password=pwd, sni=test. com , download-bandwidth= 100 Proxy = hysteria2, 192.168.20.62, 443, password=pwd, sni=test.com, download-bandwidth=100 Proxy = hysteria2, 192.168.20.62, 443, password=pwd, sni=test.com, download-bandwidth=100
Proxy = hysteria2, 192.168 . 20 . 62 , 443 , password=pwd, skip-cert-verify= true ,sni=test. com , download-bandwidth= 0 Proxy = hysteria2, 192.168.20.62, 443, password=pwd, skip-cert-verify=true,sni=test.com, download-bandwidth=0 Proxy = hysteria2, 192.168.20.62, 443, password=pwd, skip-cert-verify=true,sni=test.com, download-bandwidth=0
在Loon上使用
强烈建议使用UI界面进行添加!!!
文本格式:
loon-hy2 = Hysteria2, 192.168 . 0 . 1 , 443 ,“ilove3k”,tls-name=www. bing . com ,skip-cert-verify= true ,udp=true loon-hy2 = Hysteria2,192.168.0.1,443,“ilove3k”,tls-name=www.bing.com,skip-cert-verify=true,udp=true loon-hy2 = Hysteria2,192.168.0.1,443,“ilove3k”,tls-name=www.bing.com,skip-cert-verify=true,udp=true
完整服务端配置文档在此处:
https://v2.hysteria.network/zh/docs/advanced/Full-Server-Config/
然后:
相关推荐
Loon新手起步折腾Warp 小火箭的Warp教程 Surge && shadow-tls v3
© 版权声明 文章版权归整点猫咪&Lucky所有,未经允许请勿转载。 THE END 整点教程
教程 # surge # VPS教程 # 代理教程 # Loon教程 # Loon使用 # 协议搭建 # Hysteria2 # Loon
喜欢就支持一下叭 点赞 19 分享
QQ空间 微博 QQ好友 海报分享 复制链接 收藏
评论 共1条
请登录后发表评论
登录 注册
最新 最热 只看作者
骑个大二八 1
请问如何安装 surge 的 tf 版本? 2年前 回复
文章分类
整点心情 (9)
整点教程 (42)
整点资源 (18)
2026 年 1 月
一 二 三 四 五 六 日
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
« 1 月
给来点猫粮吧
文章 文章 用户
开启精彩搜索
热门搜索
surge snell warp stash boxjs docker .env wireguard Shadow 小火箭 懒人 优选 圈叉 青龙 监控 Shadow TLS
热门文章
注册Cloudflare并加入ZeroTrust教程
注册Cloudflare并加入ZeroTrust教程 3年前 5.3W+
优选WARP的EndPoint IP,提高本地WARP节点访问性、修改官方客户端的EndPoint IP以及解锁ChatGPT
优选WARP的EndPoint IP,提高本地WARP节点访问性、修改官方客... 3年前 2.1W+
通过VPS架设Sub-Store(新版)
通过VPS架设Sub-Store(新版) 3年前 2W+
通过Docker在VPS上架设Sub-Store
通过Docker在VPS上架设Sub-Store 3年前 1.5W+
Sub-store初步教程
Sub-store初步教程 3年前 1.4W+
手动搭建 Hysteria2 协议用于Surge/Loon
手动搭建 Hysteria2 协议用于Surge/Loon 3年前 1.4W+
搜索结果
搜索
筛选条件
排序依据: 相关性 • 最新 • 最旧
未找到结果
过滤选项
Close Search 搜索动力源自 Jetpack