Skip to content

Commit 52f3708

Browse files
committed
chore: add local hysteria server config
1 parent c2913fb commit 52f3708

File tree

5 files changed

+57
-0
lines changed

5 files changed

+57
-0
lines changed

agent-docs/hysteria.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,4 @@
7474
## 进度日志
7575

7676
- 2026-02-10:创建跟踪文档,完成协议/配置要点摘录(进行中)
77+
- 2026-02-10:新增本地联调用 server 配置与证书生成脚本:`agent-docs/hysteria/`

agent-docs/hysteria/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
cert.pem
2+
key.pem
3+

agent-docs/hysteria/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Local Hysteria v2 server (for dev)
2+
3+
This folder contains a minimal server config and helper scripts for running a **local** Hysteria v2
4+
server for integration testing.
5+
6+
## Generate a self-signed cert
7+
8+
```bash
9+
cd agent-docs/hysteria
10+
./gen-cert.sh
11+
```
12+
13+
This creates `cert.pem` and `key.pem` (ignored by git).
14+
15+
## Start server
16+
17+
```bash
18+
hysteria server -c agent-docs/hysteria/server.yaml
19+
```
20+
21+
Default settings in `server.yaml`:
22+
- listen: `127.0.0.1:18443`
23+
- auth password: `test-password`
24+

agent-docs/hysteria/gen-cert.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
5+
cd "$DIR"
6+
7+
if [[ -f cert.pem || -f key.pem ]]; then
8+
echo "cert.pem/key.pem already exist; delete them if you want to regenerate." >&2
9+
exit 1
10+
fi
11+
12+
openssl req -x509 -newkey rsa:2048 -sha256 -days 3650 -nodes \
13+
-keyout key.pem \
14+
-out cert.pem \
15+
-subj "/CN=localhost" \
16+
-addext "subjectAltName=DNS:localhost,IP:127.0.0.1,IP:::1"
17+
18+
echo "generated: cert.pem key.pem"
19+

agent-docs/hysteria/server.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
listen: 127.0.0.1:18443
2+
3+
tls:
4+
cert: agent-docs/hysteria/cert.pem
5+
key: agent-docs/hysteria/key.pem
6+
7+
auth:
8+
type: password
9+
password: test-password
10+

0 commit comments

Comments
 (0)