mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-10-01 08:36:38 +08:00
38 lines
1.4 KiB
Markdown
38 lines
1.4 KiB
Markdown
# GO-GOST SERVICE KNOWLEDGE BASE
|
|
|
|
**Generated:** Mon Feb 02 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 to `gost.{json,yaml}` via viper search paths).
|
|
- `go-gost/x/` is the primary extension surface; avoid editing vendored deps.
|
|
|
|
## COMMANDS
|
|
```bash
|
|
cd go-gost
|
|
go run .
|
|
go test ./...
|
|
go build .
|
|
```
|