@sunflower0305/claude-proxy 1.1.3 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/README.md +4 -2
- package/dist/proxy.d.ts +0 -1
- package/dist/proxy.js +4 -4
- package/package.json +3 -6
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.2.0] - 2026-05-01
|
|
6
|
+
|
|
7
|
+
Minor release of `@sunflower0305/claude-proxy`.
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- `.env` loading now uses Node.js built-in `.env` file support instead of the external `dotenv` package
|
|
12
|
+
- minimum supported Node.js version is now 20.12
|
|
13
|
+
- CORS is no longer enabled by default
|
|
14
|
+
|
|
15
|
+
### Removed
|
|
16
|
+
|
|
17
|
+
- removed runtime dependency on `dotenv`
|
|
18
|
+
- removed unused `cors` and `@types/cors` dependencies
|
|
19
|
+
|
|
20
|
+
Detailed release notes: [docs/releases/1.2.0.md](docs/releases/1.2.0.md)
|
|
21
|
+
|
|
5
22
|
## [1.1.3] - 2026-04-24
|
|
6
23
|
|
|
7
24
|
Patch release of `@sunflower0305/claude-proxy`.
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://github.com/sunflower0305/claude-proxy/actions/workflows/cd.yml)
|
|
5
5
|
[](https://coveralls.io/github/sunflower0305/claude-proxy?branch=master)
|
|
6
6
|
[](https://www.npmjs.com/package/@sunflower0305/claude-proxy)
|
|
7
|
-
[](https://www.npmjs.com/package/@sunflower0305/claude-proxy)
|
|
8
8
|
[](https://github.com/sunflower0305/claude-proxy/stargazers)
|
|
9
9
|
[](https://github.com/sunflower0305/claude-proxy/blob/master/LICENSE)
|
|
10
10
|
|
|
@@ -14,6 +14,8 @@ It currently supports `qwen`, `deepseek`, `glm`, `minimax`, and `kimi`.
|
|
|
14
14
|
|
|
15
15
|
## Install
|
|
16
16
|
|
|
17
|
+
Requires Node.js 20.12 or newer.
|
|
18
|
+
|
|
17
19
|
Run without installing:
|
|
18
20
|
|
|
19
21
|
```bash
|
|
@@ -29,7 +31,7 @@ claude-proxy
|
|
|
29
31
|
|
|
30
32
|
## Configure
|
|
31
33
|
|
|
32
|
-
The proxy reads configuration from environment variables. You can export them in your shell or create a `.env` file in the directory where you run `claude-proxy`.
|
|
34
|
+
The proxy reads configuration from environment variables. You can export them in your shell or create a `.env` file in the directory where you run `claude-proxy`; `.env` loading uses Node.js built-in `.env` file support.
|
|
33
35
|
|
|
34
36
|
Example `.env`:
|
|
35
37
|
|
package/dist/proxy.d.ts
CHANGED
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
* export ANTHROPIC_BASE_URL=http://localhost:8080
|
|
10
10
|
* export ANTHROPIC_API_KEY=any-key-works
|
|
11
11
|
*/
|
|
12
|
-
import "dotenv/config";
|
|
13
12
|
import express from "express";
|
|
14
13
|
export declare function createApp(): express.Express;
|
|
15
14
|
export declare const app: express.Express;
|
package/dist/proxy.js
CHANGED
|
@@ -9,12 +9,13 @@
|
|
|
9
9
|
* export ANTHROPIC_BASE_URL=http://localhost:8080
|
|
10
10
|
* export ANTHROPIC_API_KEY=any-key-works
|
|
11
11
|
*/
|
|
12
|
-
import "dotenv/config";
|
|
13
|
-
import cors from "cors";
|
|
14
12
|
import express from "express";
|
|
15
|
-
import { realpathSync } from "node:fs";
|
|
13
|
+
import { existsSync, realpathSync } from "node:fs";
|
|
14
|
+
import { loadEnvFile } from "node:process";
|
|
16
15
|
import { Readable } from "node:stream";
|
|
17
16
|
import { fileURLToPath } from "node:url";
|
|
17
|
+
if (existsSync(".env"))
|
|
18
|
+
loadEnvFile(".env");
|
|
18
19
|
const DEFAULT_ANTHROPIC_VERSION = "2023-06-01";
|
|
19
20
|
const HOP_BY_HOP_RESPONSE_HEADERS = new Set([
|
|
20
21
|
"connection",
|
|
@@ -307,7 +308,6 @@ export function createApp() {
|
|
|
307
308
|
}
|
|
308
309
|
}
|
|
309
310
|
const app = express();
|
|
310
|
-
app.use(cors());
|
|
311
311
|
app.use(express.json({ limit: "50mb" }));
|
|
312
312
|
app.get("/", (_req, res) => {
|
|
313
313
|
const config = getConfig();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sunflower0305/claude-proxy",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A proxy that lets Claude Agent SDK use domestic Chinese LLMs (DeepSeek, Qwen, GLM, MiniMax) as backend",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
".env.example"
|
|
24
24
|
],
|
|
25
25
|
"engines": {
|
|
26
|
-
"node": ">=
|
|
26
|
+
"node": ">=20.12"
|
|
27
27
|
},
|
|
28
28
|
"publishConfig": {
|
|
29
29
|
"access": "public"
|
|
@@ -55,20 +55,17 @@
|
|
|
55
55
|
"prepack": "npm run build",
|
|
56
56
|
"prepublishOnly": "npm run test:proxy-local",
|
|
57
57
|
"test": "vitest run",
|
|
58
|
-
"test:coverage": "vitest run tests/integration/proxy-local.test.ts --coverage --coverage.reporter=lcov --coverage.reporter=text --pool
|
|
58
|
+
"test:coverage": "vitest run tests/integration/proxy-local.test.ts --coverage --coverage.reporter=lcov --coverage.reporter=text --pool forks",
|
|
59
59
|
"test:proxy-local": "vitest run tests/integration/proxy-local.test.ts",
|
|
60
60
|
"test:provider-anthropic": "node --experimental-strip-types tests/integration/provider-anthropic.ts",
|
|
61
61
|
"test:provider-cli-e2e": "node --experimental-strip-types tests/integration/provider-cli-e2e.ts",
|
|
62
62
|
"report:provider-cli-e2e": "node --experimental-strip-types tests/integration/report-provider-cli-e2e.ts"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"cors": "^2.8.5",
|
|
66
|
-
"dotenv": "^16.4.5",
|
|
67
65
|
"express": "^4.21.0"
|
|
68
66
|
},
|
|
69
67
|
"devDependencies": {
|
|
70
68
|
"@vitest/coverage-v8": "^3.2.4",
|
|
71
|
-
"@types/cors": "^2.8.17",
|
|
72
69
|
"@types/express": "^4.17.21",
|
|
73
70
|
"@types/node": "^22.0.0",
|
|
74
71
|
"tsx": "^4.19.0",
|