本文最后更新于 330 天前,其中的信息可能已经有所发展或是发生改变。
1、一键安装脚本
bash <(curl -fsSL https://get.hy2.sh/)
2、无域名生成自签证书
命令会在 VPS 目录
/etc/hysteria
中生成server.crt
及server.key
文件,并变更相关权限
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
3、服务端配置文件
nano /etc/hysteria/config.yaml
listen: :443
tls:
cert: /etc/hysteria/server.crt
key: /etc/hysteria/server.key
auth:
type: password
password: 88888888 # 请及时更改密码
masquerade:
type: proxy
proxy:
url: https://bing.com
rewriteHost: true
4、开启服务
systemctl start hysteria-server.service # 启动 hysteria 服务
systemctl enable hysteria-server.service # 设置 hysteria 服务 开机自启
systemctl restart hysteria-server.service # 重启 hysteria 服务
systemctl stop hysteria-server.service # 停止 hysteria 服务
systemctl status hysteria-server.service # 查看 hysteria 服务 状态
5、v2rayN 配置
新建文件 hy.yml 修改ip、密码、带宽
server: <ip>:443
auth: 88888888
bandwidth:
up: 50 mbps
down: 100 mbps
tls:
sni: bing.com
insecure: true
socks5:
listen: 127.0.0.1:1080
http:
listen: 127.0.0.1:8080
6、Clash.meta配置
- name: "hysteria2"
type: hysteria2
server: ip
port: 443
up: "50 Mbps"
down: "100 Mbps"
password: 88888888
sni: bing.com
skip-cert-verify: true