Skip to content

Commit 58bd7f9

Browse files
committed
feat: add generic passthrough proxy routing
1 parent 19a4131 commit 58bd7f9

7 files changed

Lines changed: 196 additions & 224 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Variables
44
APP_NAME := mask-ctl
55
SERVICE_BINARY := coding-plan-mask
6-
VERSION := 0.6.1
6+
VERSION := 0.6.2
77
BUILD_DIR := build
88
BIN_DIR := $(BUILD_DIR)/bin
99
CMD_DIR := cmd/coding-plan-mask

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
[![Go Version](https://img.shields.io/badge/Go-1.21+-00ADD8?style=flat&logo=go)](https://golang.org/)
88
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
9-
[![Version](https://img.shields.io/badge/version-0.6.1-green.svg)](https://github.com/systemime/coding-plan-mask)
9+
[![Version](https://img.shields.io/badge/version-0.6.2-green.svg)](https://github.com/systemime/coding-plan-mask)
1010

1111
*Use your Coding Plan subscription with ANY OpenAI-compatible coding tool*
1212

@@ -66,7 +66,7 @@ Major AI providers (Zhipu GLM, Alibaba Cloud, MiniMax, DeepSeek, Moonshot, etc.)
6666
| Feature | Description |
6767
|---------|-------------|
6868
| 🎭 **Tool Masking** | Mask as Claude Code, Kimi Code, OpenClaw or custom tool |
69-
| 🔀 **Request Relay** | Relay requests to Coding Plan API endpoints |
69+
| 🔀 **Request Relay** | Transparently forward arbitrary upstream API paths |
7070
| 🔌 **Universal Compatibility** | Works with ANY OpenAI-compatible client |
7171
| 🌐 **Multi-Provider** | Support for 6+ major LLM providers |
7272
| 📊 **Usage Analytics** | Track token consumption in real-time with SQLite storage |
@@ -85,17 +85,17 @@ Download the binary for your platform from [GitHub Releases](https://github.com/
8585

8686
```bash
8787
# Linux amd64
88-
wget https://github.com/systemime/coding-plan-mask/releases/download/v0.6.1/mask-ctl-linux-amd64
88+
wget https://github.com/systemime/coding-plan-mask/releases/download/v0.6.2/mask-ctl-linux-amd64
8989
chmod +x mask-ctl-linux-amd64
9090
sudo mv mask-ctl-linux-amd64 /usr/local/bin/mask-ctl
9191

9292
# Linux arm64
93-
wget https://github.com/systemime/coding-plan-mask/releases/download/v0.6.1/mask-ctl-linux-arm64
93+
wget https://github.com/systemime/coding-plan-mask/releases/download/v0.6.2/mask-ctl-linux-arm64
9494
chmod +x mask-ctl-linux-arm64
9595
sudo mv mask-ctl-linux-arm64 /usr/local/bin/mask-ctl
9696

9797
# macOS (Darwin)
98-
wget https://github.com/systemime/coding-plan-mask/releases/download/v0.6.1/mask-ctl-darwin-arm64
98+
wget https://github.com/systemime/coding-plan-mask/releases/download/v0.6.2/mask-ctl-darwin-arm64
9999
chmod +x mask-ctl-darwin-arm64
100100
sudo mv mask-ctl-darwin-arm64 /usr/local/bin/mask-ctl
101101

@@ -206,15 +206,15 @@ disguise_tool = "claudecode" # Claude Code (recommended, compatible with Zhipu/
206206
207207
### 📡 API Endpoints
208208

209+
The proxy reserves a small set of local management endpoints and transparently forwards all other request paths to the upstream provider.
210+
209211
| Endpoint | Method | Description |
210212
|----------|--------|-------------|
211213
| `/` | GET | Service information |
212-
| `/v1/chat/completions` | POST | Chat completions (streaming supported) |
213-
| `/v1/embeddings` | POST | Text embeddings |
214-
| `/v1/models` | GET | List available models |
215214
| `/health` | GET | Health check |
216215
| `/ready` | GET | Readiness check |
217216
| `/stats` | GET | Usage statistics (JSON) |
217+
| `/*` | Any | Forward any other path to the upstream API with disguised headers |
218218

219219
### 📊 Statistics & Management
220220

@@ -305,17 +305,17 @@ This project is provided for **educational and research purposes only**.
305305

306306
```bash
307307
# Linux amd64
308-
wget https://github.com/systemime/coding-plan-mask/releases/download/v0.6.1/mask-ctl-linux-amd64
308+
wget https://github.com/systemime/coding-plan-mask/releases/download/v0.6.2/mask-ctl-linux-amd64
309309
chmod +x mask-ctl-linux-amd64
310310
sudo mv mask-ctl-linux-amd64 /usr/local/bin/mask-ctl
311311

312312
# Linux arm64
313-
wget https://github.com/systemime/coding-plan-mask/releases/download/v0.6.1/mask-ctl-linux-arm64
313+
wget https://github.com/systemime/coding-plan-mask/releases/download/v0.6.2/mask-ctl-linux-arm64
314314
chmod +x mask-ctl-linux-arm64
315315
sudo mv mask-ctl-linux-arm64 /usr/local/bin/mask-ctl
316316

317317
# macOS
318-
wget https://github.com/systemime/coding-plan-mask/releases/download/v0.6.1/mask-ctl-darwin-arm64
318+
wget https://github.com/systemime/coding-plan-mask/releases/download/v0.6.2/mask-ctl-darwin-arm64
319319
chmod +x mask-ctl-darwin-arm64
320320
sudo mv mask-ctl-darwin-arm64 /usr/local/bin/mask-ctl
321321
```
@@ -407,15 +407,15 @@ sudo systemctl start coding-plan-mask
407407

408408
### 📡 API 端点
409409

410+
代理会保留少量本地管理端点,其余任意请求路径都会透明转发到上游服务商。
411+
410412
| 端点 | 方法 | 说明 |
411413
|------|------|------|
412414
| `/` | GET | 服务信息 |
413-
| `/v1/chat/completions` | POST | 聊天补全(支持流式) |
414-
| `/v1/embeddings` | POST | 文本向量嵌入 |
415-
| `/v1/models` | GET | 可用模型列表 |
416415
| `/health` | GET | 健康检查 |
417416
| `/ready` | GET | 就绪检查 |
418417
| `/stats` | GET | 使用统计(JSON) |
418+
| `/*` | 任意 | 其余任意路径原样透传到上游 API,并附加伪装请求头 |
419419

420420
### 📊 统计与管理
421421

cmd/coding-plan-mask/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
)
2020

2121
var (
22-
version = "0.6.1"
22+
version = "0.6.2"
2323
commit = "unknown"
2424
date = "unknown"
2525
)

0 commit comments

Comments
 (0)