1.购买服务器

hosteons可通过此链接购买服务器搭建机场

https://my.hosteons.com/aff.php?aff=2285

判断服务器IP是否可用

通过cmd命令提示符窗口ping ip地址

2.通过FinalShell软件访问我们的vps服务器来搭建我们的机场

FinalShell软件https://www.hostbuf.com/t/988.html

更新相关的包和安装curl、sudo两个包

apt update -y #Debian 命令
apt install curl sudo -y #Debian 命令

Hysteria 官方的一键安装脚本

# 安装或升级到最新版本 Hysteria 2:
bash <(curl -fsSL <https://get.hy2.sh/>)

# 移除 Hysteria 2:
bash <(curl -fsSL <https://get.hy2.sh/>) --remove

无需域名,用此命令生成自签证书

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

命令会在 VPS 目录 /etc/hysteria 中生成 server.crt 及 server.key 文件(证书和密钥)

修改默认 VPS 生成的文件配置 /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

Hysteria 2常用命令

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 服务 状态