ALADOWN-阿拉下载
首页
栏目分类
Website News
Software Recommend
WebSite Recommend
Technical Tutorials
Download Area
eBOOK Palace
About Us
About Us
首页
Software Recommend
,
Technical Tutorials
正文
Hysteria 2的Realm模式各种配置方法问题汇总
poctopus
2026-09-29 AM
120℃
0条
在日本家宽网络下配置了2个Hysteria 2的主机,使用的是它最新的Realm模式,这个模式不需要公网IP,只要通过Stun打洞就可以完成用户有类似公网的体验。这里来总结一下服务端和客户端配置方法以及一些问题。 服务端可以使用Hysteria 2的官方安装方法进行直接安装。 ```csharp bash <(curl -fsSL https://get.hy2.sh/) ``` 安装完毕后,按照各自需求调整配置文件。 以下是我自己的配置,大家可以自己参照以下: ```csharp #Realm后面的id自己生成就可以,连接公共服务器的时候,最大长度64位 listen: realm://public@realm.hy2.io/04d9eb7755614177 bandwidth: up: 1 gbps down: 1 gbps #可以配置多个用户 auth: type: userpass userpass: user001: password001 user002: password002 user003: password003 #修改password后面的密码 obfs: type: salamander salamander: password: password masquerade: type: proxy proxy: url: "https://www.yahoo.com/" rewriteHost: true tls: cert: /etc/hysteria/server.crt key: /etc/hysteria/server.key sniGuard: disable resolver: type: tcp tcp: addr: 8.8.8.8:53 timeout: 4s udp: addr: 8.8.4.4:53 timeout: 4s #流量统计 API,可以自己设置ip端口,以及密码 trafficStats: listen: :9999 secret: password ``` Windows 10/11下直接使用Hysterical的客户端配置,需要使用Winsw之类把应用加载为系统服务,这样就可以通过浏览器的SmartProxy之类服务代理。 具体配置如下: ```csharp
Hysteria 2
Hysteria Client
HY2-客户端
D:\Software\hy2\hy.exe
-c D:\Software\hy2\config.yml
append
logs
``` ```csharp #这里的Server和服务器配置的需要保持一致 server: realm://public@realm.hy2.io/04d9eb7755614177 auth: user001:password #带宽配置看服务器端网络配置后适当调整,我在服务器端配置了1g,这里就配置900m,具体自己调整。 bandwidth: up: 900 mbps down: 900 mbps obfs: type: salamander salamander: password: password # 需与服务端 obfs 密码一致 #这里的pinsha256对应服务器上证书的sha256 tls: insecure: true pinSHA256: "e86508e98f19cd9c9af67d981615" resolver: type: tcp tcp: addr: 8.8.8.8:53 timeout: 4s socks5: listen: 127.0.0.1:62001 # username: user # 可选,给本地 socks5 加账号密码 # password: pass # disableUDP: false http: listen: 127.0.0.1:62002 ``` 接下来就是Windows下Sing-Box客户端的配置: ```csharp { "$schema": "https://sing-box.sagernet.org/schema.json", "dns": { "servers": [ {"tag": "local", "type": "local", "prefer_go": true}, {"tag": "ali", "type": "https", "server": "223.5.5.5"}, {"tag": "tx", "type": "https", "server": "doh.pub", "domain_resolver": "hosts"}, {"tag": "google", "type": "https", "server": "8.8.8.8", "detour": "默认代理"}, {"tag": "fakeip", "type": "fakeip", "inet4_range": "198.19.0.0/16"}, {"type": "hosts", "tag": "hosts", "predefined": {"doh.pub": ["1.12.12.21", "120.53.53.53"]}} ], "rules": [ {"query_type": ["HTTPS", "SVCB"], "action": "reject"}, {"clash_mode": "Direct", "server": "local"}, {"clash_mode": "Global", "server": "fakeip"}, {"rule_set": ["fakeipfilter-cn", "geosite-cn", "geosite-microsoft@cn", "geosite-apple@cn", "geosite-private"], "server": "local"}, {"rule_set": "fakeipfilter-!cn", "server": "google"}, {"type": "logical", "mode": "and", "rules": [{"query_type": ["A", "AAAA"]}, {"rule_set": "geosite-geolocation-!cn", "invert": true}], "action": "evaluate", "server": "google", "client_subnet": "223.5.5.0/24","timeout": "2s"}, {"match_response": true, "rule_set": "geoip-cn", "server": "local"}, {"query_type": ["A", "AAAA"], "server": "fakeip", "rewrite_ttl": 1} ], "final": "google", "strategy": "ipv4_only", "cache_capacity": 8192, "optimistic": {"enabled": true}, "reverse_mapping": true }, "outbounds": [ { "tag": "默认代理", "type": "selector", "outbounds": [ "HY2-JP1", "HY2-JP2" ] }, { "type": "hysteria2", "tag": "HY2-JP1", "server": "", "server_port": 0, "up_mbps": 1000, "down_mbps": 1000, "obfs": { "type": "salamander", "password": "password" }, "password": "user001:password001", "tls": { "enabled": true, "insecure": true }, "stream_receive_window": 0, "connection_receive_window": 0, "realm": { "server_url": "https://realm.hy2.io", "token": "public", "realm_id": "04d9eb7755614177", "stun_servers": [ "stun.miwifi.com:3478" ], "ip_version": 4, "port_mapping": { "enabled": false } } }, { "type": "hysteria2", "tag": "HY2-JP2", "server": "", "server_port": 0, "up_mbps": 1000, "down_mbps": 1000, "obfs": { "type": "salamander", "password": "password" }, "password": "user001:password001", "tls": { "enabled": true, "insecure": true }, "stream_receive_window": 0, "connection_receive_window": 0, "realm": { "server_url": "https://realm.hy2.io", "token": "public", "realm_id": "04d9eb7755614171", "stun_servers": [ "stun.miwifi.com:3478" ], "ip_version": 4, "port_mapping": { "enabled": false } } }, { "tag": "直连", "type": "direct", "domain_resolver": "ali" } ], "http_clients": [ {"tag": "直连下载", "detour": "直连"} ], "route": { "rules": [ {"type": "logical", "mode": "and", "rules": [{"port": [53, 853], "invert": true}, {"clash_mode": "Global", "invert": true}, {"type": "logical", "mode": "or", "rules": [{"ip_is_private": true}, {"rule_set": "geoip-cn"}]}], "action": "bypass"}, {"type": "logical", "mode": "or", "rules": [{"domain_suffix": "push.apple.com"}, {"rule_set": "geoip-telegram"}], "invert": true, "action": "sniff", "sniffer": ["http", "tls", "stun", "quic", "dns"], "timeout": "100ms"}, {"type": "logical", "mode": "or", "rules": [{"port": 53}, {"protocol": "dns"}], "action": "hijack-dns"}, {"ip_is_private": true, "outbound": "直连"}, {"type": "logical", "mode": "or", "rules": [{"port": 853}], "action": "reject", "no_drop": true}, {"network": "icmp", "action": "resolve"}, {"network": "icmp", "outbound": "直连"}, {"clash_mode": "Direct", "outbound": "直连"}, {"clash_mode": "Global", "outbound": "默认代理"}, {"rule_set": "geosite-private", "outbound": "直连"}, {"rule_set": "geosite-category-ai-!cn", "outbound": "默认代理"}, {"rule_set": "geosite-youtube", "outbound": "默认代理"}, {"rule_set": "geosite-google", "outbound": "默认代理"}, {"rule_set": "geosite-github", "outbound": "默认代理"}, {"rule_set": "geosite-onedrive", "outbound": "默认代理"}, {"rule_set": "geosite-microsoft@cn", "outbound": "直连"}, {"rule_set": "geosite-microsoft", "outbound": "默认代理"}, {"rule_set": "geosite-apple@cn", "outbound": "直连"}, {"rule_set": "geosite-apple", "outbound": "默认代理"}, {"rule_set": "geosite-telegram", "outbound": "默认代理"}, {"rule_set": "geosite-tiktok", "outbound": "默认代理"}, {"rule_set": "geosite-netflix", "outbound": "默认代理"}, {"rule_set": "geosite-paypal", "outbound": "默认代理"}, {"rule_set": "geosite-binance", "outbound": "默认代理"}, {"rule_set": "geosite-okx", "outbound": "默认代理"}, {"rule_set": "geosite-category-cryptocurrency", "outbound": "默认代理"}, {"rule_set": "geosite-steam@cn", "outbound": "直连"}, {"rule_set": "geosite-steam", "outbound": "默认代理"}, {"rule_set": "geosite-geolocation-!cn", "outbound": "默认代理"}, {"inbound": "mixed-in", "action": "resolve"}, {"rule_set": "geoip-telegram", "outbound": "默认代理"}, {"rule_set": "geoip-cn", "outbound": "直连"} ], "rule_set": [ {"tag": ["fakeipfilter-cn", "fakeipfilter-!cn"], "type": "remote", "format": "source", "url": "https://gh-proxy.com/https://raw.githubusercontent.com/qichiyuhub/rule/refs/heads/main/rules/{tag}.json"}, {"tag": ["geosite-category-ai-!cn", "geosite-youtube", "geosite-google", "geosite-github", "geosite-onedrive", "geosite-microsoft", "geosite-microsoft@cn","geosite-apple", "geosite-apple@cn", "geosite-telegram", "geosite-tiktok", "geosite-netflix", "geosite-paypal", "geosite-binance", "geosite-okx", "geosite-category-cryptocurrency", "geosite-steam@cn", "geosite-steam", "geosite-geolocation-!cn", "geosite-cn", "geosite-private"], "type": "remote", "format": "binary", "url": "https://gh-proxy.com/https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/{tag}.srs"}, {"tag": "geoip-telegram", "type": "remote", "format": "binary", "url": "https://gh-proxy.com/https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/sing/geo/geoip/telegram.srs"}, {"tag": "geoip-cn", "type": "remote", "format": "binary", "url": "https://gh-proxy.com/https://raw.githubusercontent.com/SagerNet/sing-geoip/rule-set/geoip-cn.srs"} ], "final": "默认代理", "default_http_client": "直连下载", "auto_detect_interface": true, "default_domain_resolver": {"server": "ali"} }, "inbounds": [ { "type": "tun", "tag": "tun-in", "interface_name": "tun0", "mtu": 1400, "address": "172.19.0.1/30", "auto_route": true, "strict_route": true, "stack": "system" }, { "type": "mixed", "tag": "mixed-in", "listen": "127.0.0.1", "listen_port": 2080 } ], "certificate": { "store": "chrome" }, "ntp": { "enabled": true, "server": "time.apple.com" }, "log": { "disabled": false, "level": "info", "timestamp": true } } ```
标签:
realm
,
sing-box
,
hysteria 2
,
hysteria
,
mtu
非特殊说明,本博所有文章均为博主原创。
如若转载,请注明出处:
https://aladown.com/archives/2603.html
上一篇
ntfsmac给 Apple Silicon Mac 用的 NTFS 读写方案
下一篇
没有了
评论已关闭
博主动态 ~
日历
◄
2026年10月
2026年09月 (1)
2026年08月 (3)
2026年06月 (1)
2026年05月 (1)
2026年04月 (2)
2026年03月 (4)
2026年02月 (2)
2026年01月 (5)
2025年12月 (4)
2025年11月 (5)
2025年10月 (12)
2025年09月 (29)
2025年08月 (7)
2025年07月 (6)
2025年06月 (2)
2025年05月 (4)
2025年04月 (1)
2025年02月 (4)
2025年01月 (3)
2024年12月 (4)
2024年10月 (1)
2024年09月 (1)
2024年08月 (1)
2024年07月 (6)
2024年06月 (11)
2024年05月 (10)
2024年04月 (11)
2024年03月 (3)
2024年02月 (1)
2024年01月 (1)
2023年12月 (1)
2023年11月 (3)
2023年10月 (4)
2023年09月 (1)
2023年07月 (2)
2023年06月 (1)
2023年05月 (3)
2023年04月 (1)
2023年03月 (3)
2023年02月 (4)
2023年01月 (5)
2022年11月 (1)
2022年10月 (1)
2022年08月 (3)
2022年05月 (1)
2022年04月 (1)
2022年03月 (2)
2022年02月 (1)
2022年01月 (1)
2021年12月 (3)
2021年11月 (3)
2021年10月 (4)
2021年09月 (5)
2021年08月 (2)
2021年07月 (2)
2021年06月 (8)
2021年04月 (1)
2021年02月 (5)
2021年01月 (5)
2020年12月 (2)
2020年11月 (2)
2020年10月 (1)
2020年09月 (3)
2020年07月 (4)
2020年06月 (1)
2020年04月 (4)
2020年03月 (7)
2020年02月 (6)
2020年01月 (1)
2019年12月 (2)
2019年11月 (1)
2019年10月 (4)
2019年09月 (4)
2019年08月 (10)
2019年07月 (8)
2019年06月 (10)
2019年05月 (7)
2019年04月 (4)
2019年03月 (3)
2019年01月 (2)
2018年10月 (2)
2018年09月 (3)
2018年08月 (2)
2018年06月 (1)
2018年04月 (2)
2018年03月 (1)
2018年02月 (5)
2018年01月 (1)
2017年09月 (2)
2017年08月 (2)
2017年07月 (1)
2016年09月 (1)
2016年05月 (2)
2015年04月 (2)
2015年03月 (1)
2014年08月 (1)
2014年07月 (1)
2014年06月 (1)
2013年11月 (1)
2013年03月 (1)
2011年09月 (2)
2011年07月 (1)
2011年05月 (2)
2011年04月 (8)
2011年03月 (3)
2011年02月 (3)
2010年12月 (1)
2010年10月 (1)
2010年09月 (4)
2010年07月 (4)
2010年05月 (3)
2010年04月 (5)
2010年03月 (11)
2010年02月 (9)
2010年01月 (17)
2009年10月 (1)
2009年01月 (1)
2008年10月 (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
栏目分类
Website News
327
Software Recommend
49
WebSite Recommend
6
Technical Tutorials
20
Download Area
37
eBOOK Palace
2
标签云
WIN11
内网共享
解码
DHCP
番号
IKE
卸载
caddy
sqlserver
CDN
STT
IT168
奈飞
onedrive
防火墙
海淘
zelay
0DAY
视频号
chatgpt
VPN
AMD
ma c
黄金会员
IMDB
编码
cha'jian
port-forward
singbox
ROBCOPY
haproxy
centos
海关
转换
减肥
银河奇异果
SPEEDTEST
BASE64
IKEV2
screen
MeiJi
HEIC
FAT
SWF
ai
BACKUP
NTFS
联通plus
KIT TOOLS
小程序
PP
虚拟内存
官方脚本
Coupon
微软拼音
SFTP SERVER
set-hostname
LOCK
resolve.conf
贝康安
STRONGSWAN
dockerhub
益生菌
KVM
win 10
TECHWEB
alashop.com
渗透
Electron
ipcheck
EXFAT
Debian
食品
健安喜
lean
燃烧脂肪
安全中心
pcap
优惠券
推流
api
XFTP
BT.CN
纽曼斯DHA
PVE
字幕
EPEL
credssp
Actions
中国直连
recovery
Authenticator
改版
ipset
上传大文件
2008
美国运费
IOS
婴幼儿童
IDM
评论已关闭