hysteria
hysteria copied to clipboard
关于hysteria2二级代理
请问在使用了MisakaNo这位大佬的hysteria2一键脚本搭建hy2节点后,导入nekoray使用
但是我想设置hy2的二级代理我应该怎么做呢?我想达到主力服务器在访问奈飞,paypal或者某些网站时转发到hk落地服务器访问,其余时候不转发的效果。这个时候问题就比较多:1.落地服务器可以也用hy2还是只能搭建socks5 ;2.单独配置nekoray里节点的出站json能不能达到效果;3.看hy2官方文档,要配置hy2服务端的acl和出站规则,实在看不明白。询问了很多人,结果都不会。有大佬能详细讲讲吗,十分感谢
acl:
inline:
- proxy(geosite:paypal)
- proxy(geosite:netflix)
outbounds:
- name: final
type: direct
- name: proxy
type: socks5
socks5:
addr: shady.proxy.ru:1080
username: xx
password: xx
只能http和socks5出站,配置教程已经写的很详细了。
acl: inline: - proxy(geosite:paypal) - proxy(geosite:netflix) outbounds: - name: final type: direct - name: proxy type: socks5 socks5: addr: shady.proxy.ru:1080 username: xx password: xx
只能http和socks5出站,配置教程已经写的很详细了。
好的,我试着手动搭建一下,十分感谢
我在修改了/etc/hysteria/config.yaml后,重启了hy2服务,但是直接无法正常上网了,nekoray或者v2rayn都是一样的情况。还原配置后可以正常使用。socks5使用x-ui搭建。all_proxy=socks5h://用户名:密码@ip:443 curl -v https://cloudflare.com/cdn-cgi/trace
这段代码也能成功运行
listen: :443
tls:
cert: /etc/hysteria/cert.crt
key: /etc/hysteria/private.key
quic:
initStreamReceiveWindow:
maxStreamReceiveWindow:
initConnReceiveWindow:
maxConnReceiveWindow:
auth:
type: password
password:
masquerade:
type: proxy
proxy:
url: https://xxxxxxx
rewriteHost: true
outbounds:
- name: final
type: direct
- name: some_proxy
type: socks5
socks5:
addr:xxx.xx.xx.xxx:443
username:xxxxxxxxx
password:xxxxxxxx
acl:
inline:
- some_proxy(geosite:paypal)
- some_proxy(geosite:netflix)
- direct(all)
注意缩进位,acl和outbounds是同一位置,另外我没有写- direct(all)
这条。
addr:xxx.xx.xx.xxx:443
username:xxxxxxxxx
password:xxxxxxxx
:后有空格
注意缩进位,acl和outbounds是同一位置,另外我没有写
- direct(all)
这条。addr:xxx.xx.xx.xxx:443 username:xxxxxxxxx password:xxxxxxxx
:后有空格
感谢,已经成功了
这个例子很实用 特别是没有软路由的情况下HY2可以使用acl实现分流
acl: inline: - proxy(geosite:paypal) - proxy(geosite:netflix) outbounds: - name: final type: direct - name: proxy type: socks5 socks5: addr: shady.proxy.ru:1080 username: xx password: xx
只能http和socks5出站,配置教程已经写的很详细了。
我就是这样配置的,但是奈飞还是没走socks5代理;outbounds只留proxy才会走socks5代理,但是会全局走socks5代理。
Make sure there are no extra spaces after the addr
, username
, and password
fields in the socks5
outbound configuration.
我也是同样的问题,如果server配置项中outbound有其他内容,则后面的proxy就失效了,非内容编排原因导致。 注:2024年6月3日安装的最新版本
另外,尝试修改outbound的顺序,感觉整个访问都会走第一个outbound配置。