搭建hysteria2 服务端

作者:matrix 被围观: 772 次 发布时间:2024-01-31 分类:零零星星 | 3 条评论 »

服务器配置

配置文件的目录
/root/hysteria

自签证书key crt生成

openssl req -x509 -nodes -newkey ec:<(openssl ecparam -name prime256v1) -keyout /root/hysteria/server.key -out /root/hysteria/server.crt -subj "/CN=bing.com" -days 36500

# sudo chown hysteria /root/hysteria/server.key
# sudo chown hysteria /root/hysteria/server.crt

新建hysteria2.yaml文件


listen: :443 #监听端口 #使用CA证书 #acme: # domains: # - hhtjim.com #你的域名,需要先解析到服务器ip # email: test@hhtjim.com #使用自签证书 tls: cert: /app/server.crt key: /app/server.key auth: type: password password: 999999 #设置认证密码 masquerade: type: proxy proxy: url: https://www.baidu.com #伪装网址 rewriteHost: true

最终需要的三个文件

hysteria2.yaml
server.crt
server.key

启动服务

docker run -v /root/hysteria:/app/ --net=host --rm -it tobyxdd/hysteria server  -c /app/hysteria2.yaml

客户端使用

新建配置文件hysteria2-client.yaml


# 服务器信息及端口 server: server.hhtjim.com:443 auth: 999999 # 根据本地带宽设置上下行 bandwidth: up: 20 mbps down: 300 mbps tls: insecure: true #使用自签时需要改成true socks5: listen: 127.0.0.1:1084 http: listen: 127.0.0.1:8084

启动


docker run -v $(pwd)/hysteria2-client.yaml:/app/hysteria2.yaml --net=host --name=hysteria2-client -d tobyxdd/hysteria client -c /app/hysteria2.yaml

参考:
https://vpsxb.net/5008/

https://raw.githubusercontent.com/chika0801/hysteria-install/main/config_server.yaml

https://bulianglin.com/archives/hysteria2.html

部署Docker版Hysteria服务端

其他文章:
本文固定链接:https://www.hhtjim.com/hysteria2.html
matrix
本文章由 matrix 于2024年01月31日发布在零零星星分类下,目前没有通告,你可以至底部留下评论。
转载请注明:搭建hysteria2 服务端-HHTjim'S 部落格
关键字:,

有3 条评论 »

  1. 九凌网络 九凌网络 2024-4-2 16:13:05 +0800#2

    没看懂

  2. SUMER SUMER 2024-2-8 19:39:32 +0800#1

    外链转换工具已经很老旧了,很多网站都无法转换。大佬啥时候有空更新一下

    • matrix matrix Moderator 2024-3-26 17:50:25 +0800

      有推荐的平台吗 有时间我补充上

添加新评论 »

 🙈 😱 😂 😛 😭 😳 😀 😆 👿 😉 😯 😮 😕 😎 😐 😥 😡 😈 💡

插入图片

NOTICE: You should type some Chinese word (like “你好”) in your comment to pass the spam-check, thanks for your patience!