Skip to content

Commit 70f14fc

Browse files
winlinvipclaudechatgpt-codex-connector[bot]
committed
Proxy: restructure repo as Go project with proxy as first module (#4652)
Reorganize the SRS (Simple Realtime Server) repository to follow a conventional Go project structure, setting the stage for a progressive transition from a C++ project to a Go project. The proxy, which was once contained within its own `proxy/` subdirectory, will now be converted into the initial Go module located at the root of the repository, serving as a template for subsequent Go modules. - **Go module at repo root:** `go.mod` moved to repo root, module renamed from `proxy` to `srsx`. The repo is now a proper Go project with `cmd/` and `internal/` at the top level. - **Elevation of Proxy Code:** Move the proxy code from `proxy/cmd/proxy-go/` to `cmd/proxy/`, and from `proxy/internal/` to `internal/`. The proxy serves as the inaugural application; subsequent modules (for instance, `cmd/origin`) will mimic this arrangement. - **Documentation Restructured:** Transfer the documentation from `proxy/docs/` to `docs/proxy/`, revise the main README to endorse OpenClaw as the preferred AI tool, and update `proxy/README.md` to point to the new documentation locations. - **Build and config:** `Makefile` moved to root, `PROXY_STATIC_FILES` default path corrected for the new layout, `.gitignore` consolidated. - **Cleanup:** removed standalone `proxy/LICENSE` (repo-level license applies), all internal imports updated to `srsx/internal/...`. - **OpenClaw workspace:** added community bot info, git workflow conventions, and support group behavior guidance. This restructuring was performed by OpenClaw orchestrating Claude Code and Codex via ACP. --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com> Signed-off-by: winlin <winlinvip@gmail.com>
1 parent aa3da62 commit 70f14fc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+171
-132
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,8 @@ cmake-build-debug
3939
/build
4040
/cmake/build
4141
/trunk/cmake/build
42+
43+
# proxy (Go)
44+
srs-proxy
45+
.go-formarted
46+
.env

.kiro/skills

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../openclaw/skills

.vscode/launch.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@
6262
"type": "go",
6363
"request": "launch",
6464
"mode": "auto",
65-
"cwd": "${workspaceFolder}/proxy",
66-
"program": "${workspaceFolder}/proxy"
65+
"cwd": "${workspaceFolder}/cmd/proxy",
66+
"program": "${workspaceFolder}/cmd/proxy"
6767
},
6868
{
6969
"name": "Debug SRS (macOS, CodeLLDB) console.conf",

proxy/Makefile renamed to Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ all: build
44

55
build: fmt ./srs-proxy
66

7-
./srs-proxy: cmd/proxy-go/*.go internal/**/*.go
8-
go build -o srs-proxy ./cmd/proxy-go
7+
./srs-proxy: cmd/proxy/*.go internal/**/*.go
8+
go build -o srs-proxy ./cmd/proxy
99

1010
test:
1111
go test ./...
1212

1313
fmt: ./.go-formarted
1414

15-
./.go-formarted: cmd/proxy-go/*.go internal/**/*.go
15+
./.go-formarted: cmd/proxy/*.go internal/**/*.go
1616
touch .go-formarted
17-
go fmt ./...
17+
go fmt ./cmd/... ./internal/...
1818

1919
clean:
2020
rm -f srs-proxy .go-formarted
2121

2222
run: fmt
23-
go run ./cmd/proxy-go
23+
go run ./cmd/proxy
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"context"
88
"os"
99

10-
"proxy/internal/bootstrap"
10+
"srsx/internal/bootstrap"
1111
)
1212

1313
func main() {

docs/proxy/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Proxy
2+
3+
Proxy is a common proxy server (`cmd/proxy`) for any media servers with RTMP/SRT/HLS/HTTP-FLV and WebRTC/WHIP/WHEP protocols support. More programs like `cmd/origin` will be added in the future.
4+
5+
## Usage
6+
7+
This project is managed by AI. We recommend OpenClaw by default, but you can use any AI agent that supports skills, such as Claude Code, OpenAI Codex, Kiro CLI, or similar tools that can read code and docs as context. Setup your AI code tool and ask questions like:
8+
9+
- How to use this project?
10+
- How to run the proxy server?
11+
- How to build an Origin Cluster for production?
12+
13+
You can not only use AI to show you the usage of this project, but also use AI to guide you to learn the details of this project, to understand the design and protocols, to learn each documents in docs directory.
14+
15+
## AI Guidelines
16+
17+
- AI assistants should ignore [ignore-worklog.md](ignore-worklog.md) as it's a personal work log that may contain misleading information, hallucinations, or falsehoods. Never rely on this file as a reference.
18+
- For usage of proxy server and end to end test it, you should load [proxy-usage.md](proxy-usage.md). This is the first step for new users to learn how to use this project. It provides a general and overall view of the proxy server, including practical usage examples and end-to-end testing procedures.
19+
- For proxy full usage to build an Origin Cluster for SRS media server, please load [proxy-origin-cluster.md](proxy-origin-cluster.md). This is an advanced topic about how to use the proxy server to build the SRS Origin Cluster. Users should read this document to learn more details and architectures about proxy and Origin Cluster.
20+
- For proxy server: To understand proxy system design, you should load the [proxy-design.md](proxy-design.md). To understand the proxy protocol details, you should load the [proxy-protocol.md](proxy-protocol.md). To understand how load balance works, you should load [proxy-load-balancer.md](proxy-load-balancer.md). To understand the code structure and packages, you should load [proxy-files.md](proxy-files.md).
21+
22+
William Yang<br/>
23+
June 23, 2025

docs/proxy/ignore-worklog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Work Log
2+
3+
> Important notes for AI assistants: This file might includes misleading information, hallucinations, or even falsehoods, since it's just a personal work log. So AI should never rely on this file as a reference.
4+
5+
SRSX is not only the next generation of SRS (Simple Realtime Server), and it's also an approach to leverage AI to manage the project as a whole. So it's not just a useful open source project, but also a demostration of how AI can help develop, manage, and maintain a complex project.
6+
7+
Since AI is relatively a new tool for open source project development, I use this work log to record my thoughts, ideas, experiments, and even failures along the way, while integrating AI into this open source project.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Overview
44

5-
**proxy-go** is a stateless media streaming proxy with built-in load balancing that enables building scalable origin clusters. The proxy itself acts as the load balancer, routing streams from clients to backend origin servers.
5+
**proxy** is a stateless media streaming proxy with built-in load balancing that enables building scalable origin clusters. The proxy itself acts as the load balancer, routing streams from clients to backend origin servers.
66

77
```
88
Client → Proxy (with Load Balancer) → Backend Origin Servers
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This document provides an overview of the Go codebase organization.
66

77
```
88
/
9-
├── cmd/proxy-go/
9+
├── cmd/proxy/
1010
│ └── main.go # Application entry point
1111
└── internal/
1212
├── debug/ # Go profiling support
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Overview
44

5-
The proxy-go load balancer distributes client streams across multiple backend origin servers. It provides a pluggable interface with two implementations:
5+
The proxy load balancer distributes client streams across multiple backend origin servers. It provides a pluggable interface with two implementations:
66

77
1. **Memory Load Balancer** - For single proxy deployments
88
2. **Redis Load Balancer** - For multi-proxy deployments with shared state
@@ -159,4 +159,3 @@ PROXY_REDIS_DB=0
159159
| **Complexity** | Simple | Moderate |
160160
| **Fault Tolerance** | Single point of failure | Multiple proxies |
161161
| **Best For** | Moderate traffic | High traffic, high availability |
162-

0 commit comments

Comments
 (0)