自签名证书
openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 3650 -out certificate.pem
服务端
创建配置文件 config.json
{
"listen": ":443",
"cert": "/etc/hysteria/certificate.pem",
"key": "/etc/hysteria/key.pem",
"up_mbps": 300,
"down_mbps": 300,
"obfs": "dankdhsawj"
}
运行
hysteria server
hysteria -config /etc/hysteria/config.json server
客户端
iOS
Linux
{
"server": "1.1.1.1:443",
"obfs": "1231",
"up_mbps": 300,
"down_mbps": 300,
"socks5": {
"listen": "127.0.0.1:1080"
},
"insecure": true
}
- 然后直接运行
hysteria
就可以,之后可以用 proxychains 之类的工具了。如有需要也可以添加 http 字段
"http": {
"listen": "127.0.0.1:8080"
}
systemd 自动启动
/lib/systemd/system/hysteria.service
[Unit]
Description=Hysteria
After=network.target network-online.target nss-lookup.target
[Service]
Restart=on-failure
Type=simple
ExecStart=/usr/sbin/hysteria -config /etc/hysteria/config.json server
[Install]
WantedBy=multi-user.target
systemctl daemon-reload # 重新加载
systemctl enable hysteria # 开机自启
systemctl start hysteria # 启动