Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
a30571dae2 | |||
24d6d6982d | |||
cfa19f27cc | |||
03cc490b8a |
21
changelog.md
21
changelog.md
@ -1,5 +1,26 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2025-04-30 - 7.1.4 - fix(dependencies)
|
||||||
|
Update dependency versions in package.json
|
||||||
|
|
||||||
|
- Bump @git.zone/tsbuild from ^2.2.6 to ^2.3.2
|
||||||
|
- Bump @push.rocks/tapbundle from ^5.5.10 to ^6.0.0
|
||||||
|
- Bump @types/node from ^22.13.10 to ^22.15.3
|
||||||
|
- Bump typescript from ^5.8.2 to ^5.8.3
|
||||||
|
- Bump @push.rocks/lik from ^6.1.0 to ^6.2.2
|
||||||
|
- Add @push.rocks/smartnetwork at ^4.0.0
|
||||||
|
- Bump @push.rocks/smartrequest from ^2.0.23 to ^2.1.0
|
||||||
|
- Bump @tsclass/tsclass from ^5.0.0 to ^9.1.0
|
||||||
|
- Bump @types/ws from ^8.18.0 to ^8.18.1
|
||||||
|
- Update ws to ^8.18.1
|
||||||
|
|
||||||
|
## 2025-04-28 - 7.1.3 - fix(docs)
|
||||||
|
Update project hints documentation in readme.hints.md
|
||||||
|
|
||||||
|
- Added comprehensive hints covering project overview, repository structure, and development setup.
|
||||||
|
- Outlined testing framework, coding conventions, and key components including ProxyRouter and SmartProxy.
|
||||||
|
- Included detailed information on TSConfig settings, Mermaid diagrams, CLI usage, and future TODOs.
|
||||||
|
|
||||||
## 2025-04-19 - 7.1.2 - fix(networkproxy/requesthandler)
|
## 2025-04-19 - 7.1.2 - fix(networkproxy/requesthandler)
|
||||||
Improve HTTP/2 request handling and error management in the proxy request handler; add try-catch around routing and update header processing to support per-backend protocol overrides.
|
Improve HTTP/2 request handling and error management in the proxy request handler; add try-catch around routing and update header processing to support per-backend protocol overrides.
|
||||||
|
|
||||||
|
19
package.json
19
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@push.rocks/smartproxy",
|
"name": "@push.rocks/smartproxy",
|
||||||
"version": "7.1.2",
|
"version": "7.1.4",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "A powerful proxy package that effectively handles high traffic, with features such as SSL/TLS support, port proxying, WebSocket handling, dynamic routing with authentication options, and automatic ACME certificate management.",
|
"description": "A powerful proxy package that effectively handles high traffic, with features such as SSL/TLS support, port proxying, WebSocket handling, dynamic routing with authentication options, and automatic ACME certificate management.",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
@ -15,22 +15,23 @@
|
|||||||
"buildDocs": "tsdoc"
|
"buildDocs": "tsdoc"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@git.zone/tsbuild": "^2.2.6",
|
"@git.zone/tsbuild": "^2.3.2",
|
||||||
"@git.zone/tsrun": "^1.2.44",
|
"@git.zone/tsrun": "^1.2.44",
|
||||||
"@git.zone/tstest": "^1.0.77",
|
"@git.zone/tstest": "^1.0.77",
|
||||||
"@push.rocks/tapbundle": "^5.5.10",
|
"@push.rocks/tapbundle": "^6.0.0",
|
||||||
"@types/node": "^22.13.10",
|
"@types/node": "^22.15.3",
|
||||||
"typescript": "^5.8.2"
|
"typescript": "^5.8.3"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@push.rocks/lik": "^6.1.0",
|
"@push.rocks/lik": "^6.2.2",
|
||||||
"@push.rocks/smartdelay": "^3.0.5",
|
"@push.rocks/smartdelay": "^3.0.5",
|
||||||
|
"@push.rocks/smartnetwork": "^4.0.0",
|
||||||
"@push.rocks/smartpromise": "^4.2.3",
|
"@push.rocks/smartpromise": "^4.2.3",
|
||||||
"@push.rocks/smartrequest": "^2.0.23",
|
"@push.rocks/smartrequest": "^2.1.0",
|
||||||
"@push.rocks/smartstring": "^4.0.15",
|
"@push.rocks/smartstring": "^4.0.15",
|
||||||
"@tsclass/tsclass": "^5.0.0",
|
"@tsclass/tsclass": "^9.1.0",
|
||||||
"@types/minimatch": "^5.1.2",
|
"@types/minimatch": "^5.1.2",
|
||||||
"@types/ws": "^8.18.0",
|
"@types/ws": "^8.18.1",
|
||||||
"acme-client": "^5.4.0",
|
"acme-client": "^5.4.0",
|
||||||
"minimatch": "^10.0.1",
|
"minimatch": "^10.0.1",
|
||||||
"pretty-ms": "^9.2.0",
|
"pretty-ms": "^9.2.0",
|
||||||
|
1462
pnpm-lock.yaml
generated
1462
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -1 +1,64 @@
|
|||||||
|
# SmartProxy Project Hints
|
||||||
|
|
||||||
|
## Project Overview
|
||||||
|
- Package: `@push.rocks/smartproxy` – high-performance proxy supporting HTTP(S), TCP, WebSocket, and ACME integration.
|
||||||
|
- Written in TypeScript, compiled output in `dist_ts/`, uses ESM with NodeNext resolution.
|
||||||
|
|
||||||
|
## Repository Structure
|
||||||
|
- `ts/` – TypeScript source files:
|
||||||
|
- `index.ts` exports main modules.
|
||||||
|
- `plugins.ts` centralizes native and third-party imports.
|
||||||
|
- Subdirectories: `networkproxy/`, `nftablesproxy/`, `port80handler/`, `redirect/`, `smartproxy/`.
|
||||||
|
- Key classes: `ProxyRouter` (`classes.router.ts`), `SmartProxy` (`classes.smartproxy.ts`), plus handlers/managers.
|
||||||
|
- `dist_ts/` – transpiled `.js` and `.d.ts` files mirroring `ts/` structure.
|
||||||
|
- `test/` – test suites in TypeScript:
|
||||||
|
- `test.router.ts` – routing logic (hostname matching, wildcards, path parameters, config management).
|
||||||
|
- `test.smartproxy.ts` – proxy behavior tests (TCP forwarding, SNI handling, concurrency, chaining, timeouts).
|
||||||
|
- `test/helpers/` – utilities (e.g., certificates).
|
||||||
|
- `assets/certs/` – placeholder certificates for ACME and TLS.
|
||||||
|
|
||||||
|
## Development Setup
|
||||||
|
- Requires `pnpm` (v10+).
|
||||||
|
- Install dependencies: `pnpm install`.
|
||||||
|
- Build: `pnpm build` (runs `tsbuild --web --allowimplicitany`).
|
||||||
|
- Test: `pnpm test` (runs `tstest test/`).
|
||||||
|
- Format: `pnpm format` (runs `gitzone format`).
|
||||||
|
|
||||||
|
## Testing Framework
|
||||||
|
- Uses `@push.rocks/tapbundle` (`tap`, `expect`, `expactAsync`).
|
||||||
|
- Test files: must start with `test.` and use `.ts` extension.
|
||||||
|
- Run specific tests via `tsx`, e.g., `tsx test/test.router.ts`.
|
||||||
|
|
||||||
|
## Coding Conventions
|
||||||
|
- Import modules via `plugins.ts`:
|
||||||
|
```ts
|
||||||
|
import * as plugins from './plugins.ts';
|
||||||
|
const server = new plugins.http.Server();
|
||||||
|
```
|
||||||
|
- Reference plugins with full path: `plugins.acme`, `plugins.smartdelay`, `plugins.minimatch`, etc.
|
||||||
|
- Path patterns support globs (`*`) and parameters (`:param`) in `ProxyRouter`.
|
||||||
|
- Wildcard hostname matching leverages `minimatch` patterns.
|
||||||
|
|
||||||
|
## Key Components
|
||||||
|
- **ProxyRouter**
|
||||||
|
- Methods: `routeReq`, `routeReqWithDetails`.
|
||||||
|
- Hostname matching: case-insensitive, strips port, supports exact, wildcard, TLD, complex patterns.
|
||||||
|
- Path routing: exact, wildcard, parameter extraction (`pathParams`), returns `pathMatch` and `pathRemainder`.
|
||||||
|
- Config API: `setNewProxyConfigs`, `addProxyConfig`, `removeProxyConfig`, `getHostnames`, `getProxyConfigs`.
|
||||||
|
- **SmartProxy**
|
||||||
|
- Manages one or more `net.Server` instances to forward TCP streams.
|
||||||
|
- Options: `preserveSourceIP`, `defaultAllowedIPs`, `globalPortRanges`, `sniEnabled`.
|
||||||
|
- DomainConfigManager: round-robin selection for multiple target IPs.
|
||||||
|
- Graceful shutdown in `stop()`, ensures no lingering servers or sockets.
|
||||||
|
|
||||||
|
## Notable Points
|
||||||
|
- **TSConfig**: `module: NodeNext`, `verbatimModuleSyntax`, allows `.js` extension imports in TS.
|
||||||
|
- Mermaid diagrams and architecture flows in `readme.md` illustrate component interactions and protocol flows.
|
||||||
|
- CLI entrypoint (`cli.js`) supports command-line usage (ACME, proxy controls).
|
||||||
|
- ACME and certificate handling via `Port80Handler` and `helpers.certificates.ts`.
|
||||||
|
|
||||||
|
## TODOs / Considerations
|
||||||
|
- Ensure import extensions in source match build outputs (`.ts` vs `.js`).
|
||||||
|
- Update `plugins.ts` when adding new dependencies.
|
||||||
|
- Maintain test coverage for new routing or proxy features.
|
||||||
|
- Keep `ts/` and `dist_ts/` in sync after refactors.
|
0
readme.plan.md
Normal file
0
readme.plan.md
Normal file
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@push.rocks/smartproxy',
|
name: '@push.rocks/smartproxy',
|
||||||
version: '7.1.2',
|
version: '7.1.4',
|
||||||
description: 'A powerful proxy package that effectively handles high traffic, with features such as SSL/TLS support, port proxying, WebSocket handling, dynamic routing with authentication options, and automatic ACME certificate management.'
|
description: 'A powerful proxy package that effectively handles high traffic, with features such as SSL/TLS support, port proxying, WebSocket handling, dynamic routing with authentication options, and automatic ACME certificate management.'
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user