mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-09-30 16:26:36 +08:00
9a9e83dda0
Add comprehensive documentation of project conventions including: - Encryption patterns (AES with node secret PSK) - API envelope structure (code, msg, data, ts) - Build peculiarities (minify: false, rolldown-vite, UPX compression) - Unique styles (flat monorepo, asymmetric Go layout, hybrid frontend mode) - Module boundaries and anti-patterns - Large file hotspots and code map references Updated 7 AGENTS.md files across root and submodules.
1.6 KiB
1.6 KiB
GO-GOST SERVICE KNOWLEDGE BASE
Generated: Sun Feb 15 2026
OVERVIEW
Forwarding agent built on GOST v3 with a local fork of github.com/go-gost/x under x/.
Stack: Go 1.23, github.com/go-gost/core v0.3.1, local go-gost/x module.
STRUCTURE
go-gost/
├── main.go # Entry; reads panel config.json; starts svc.Run(program)
├── config.go # Panel config.json loader (addr/secret + ports)
├── program.go # GOST runtime: parse config, run/reload services
├── x/ # Local fork of github.com/go-gost/x (has its own go.mod)
└── go.mod # replace github.com/go-gost/x => ./x
WHERE TO LOOK
| Task | Location | Notes |
|---|---|---|
| Panel integration config | go-gost/config.go |
Expects config.json in cwd by default |
| Service lifecycle/reload | go-gost/program.go |
Parses config; handles SIGHUP reload |
| WebSocket reporting | go-gost/main.go |
Starts reporter + sets HTTP report URL |
| Protocol behaviors | go-gost/x/ |
Handlers/listeners/dialers live here |
CONVENTIONS
- Two configs exist: panel integration uses
config.json; forwarding services use GOST config (defaults togost.{json,yaml}via viper search paths). go-gost/x/is the primary extension surface; avoid editing vendored deps.- Agent communicates with panel via WebSocket (real-time commands) + HTTP (batch traffic reports).
- All panel communication uses AES encryption with node
secretas PSK.
ANTI-PATTERNS
- DO NOT EDIT generated protobuf in
x/internal/util/grpc/proto/.
COMMANDS
cd go-gost
go run .
go test ./...
go build .