Hysteria 是一个强大、快速、抗封锁的代理工具,对比naiveproxy在速度上有明显优势。

hysteria的服务端和客户端程序一样,最新版本为2.6.4, 下载地址:
Linux amd64版:https://github.com/apernet/hysteria/releases/download/app%2Fv2.6.4/hysteria-linux-amd64
Windows amd64版:https://github.com/apernet/hysteria/releases/download/app%2Fv2.6.4/hysteria-windows-amd64.exe

服务端部署

  1. 下载服务端,部署到/usr/local/bin
  2. 编写配置文件

    # /etc/hysteria/config.yaml
    listen: :8443
    tls:
      cert: <证书路径>
      key: <密钥路径>
    
    auth:
      type: password
      password: <协议密码>
    
    masquerade:
      type: proxy
      proxy:
     url: https://www.bing.com/
     rewriteHost: true
     insecure: false
    
    obfs:
      type: salamander
      salamander:
     password: <混淆密码>
    
    ignoreClientBandwidth: false
  3. 编写service文件

    # /etc/systemd/system/hysteria-server.service
    [Unit]
    Description=Hysteria Server Service (config.yaml)
    After=network.target
    
    [Service]
    Type=simple
    ExecStart=/usr/local/bin/hysteria server --config /etc/hysteria/config.yaml
    WorkingDirectory=~
    User=hysteria
    Group=hysteria
    Environment=HYSTERIA_LOG_LEVEL=info
    CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_RAW
    AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_RAW
    NoNewPrivileges=true
    
    [Install]
    WantedBy=multi-user.target
  4. 启动服务

    systemctl start hysteria
    systemctl enable hysteria
  5. 获取证书指纹备用

    openssl x509 -noout -fingerprint -sha256 -in <证书路径>

客户端部署

  1. 编写配置文件

    server: <服务器域名>:8443 
    
    auth: <协议密码>
    
    obfs:
      type: salamander
      salamander:
     password: <混淆密码>
    
    tls:
      insecure: true
      pinSHA256: <证书指纹>
    
    ignoreClientBandwidth: false
    
    socks5: 
      listen: 127.0.0.1:9080 
    
    http: 
      listen: 127.0.0.1:9090 
  2. 启动客户端或设置为服务

    hysteria.exe client -c <客户端配置文件路径>

参考

https://v2.hysteria.network/zh/docs/getting-started/Server/

https://zhige.me/2025/06/02/install-hysteria2-on-debian-11/

https://chiban.fyi/archives/jian-dan-hysteria-2fu-wu-duan-pei-zhi-wen-jian

标签: none

添加新评论