Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
3502807023 | |||
c6dff8b78d | |||
12b18373db | |||
30c25ec70c | |||
434834fc06 | |||
e7243243d0 | |||
cce2aed892 | |||
8cd693c063 | |||
09ad7644f4 | |||
f72f884eda | |||
73f3dfcad4 | |||
8291f1f33a | |||
f512fb4252 | |||
1f3ee1eafc |
45
changelog.md
45
changelog.md
@ -1,5 +1,50 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2025-05-04 - 10.0.7 - fix(core)
|
||||||
|
refactor: Rename IPortProxySettings to ISmartProxyOptions in internal modules
|
||||||
|
|
||||||
|
- Replaced IPortProxySettings with ISmartProxyOptions in connection handler, connection manager, domain config manager, security manager, timeout manager, TLS manager, and network proxy bridge.
|
||||||
|
- Updated type imports and constructors accordingly while preserving backward compatibility via export alias.
|
||||||
|
|
||||||
|
## 2025-05-04 - 10.0.6 - fix(smartproxy)
|
||||||
|
No changes detected in project files. This commit updates commit info without modifying any functionality.
|
||||||
|
|
||||||
|
|
||||||
|
## 2025-05-04 - 10.0.5 - fix(exports/types)
|
||||||
|
Refactor exports and remove duplicate IReverseProxyConfig interface
|
||||||
|
|
||||||
|
- Removed redundant IReverseProxyConfig extension from ts/common/types.ts
|
||||||
|
- Updated ts/index.ts to export networkproxy via index.js instead of classes.np.networkproxy.js
|
||||||
|
- Simplified module exports to avoid duplicate interface definitions
|
||||||
|
|
||||||
|
## 2025-05-04 - 10.0.4 - fix(core)
|
||||||
|
Refactor module exports and update packageManager version in package.json
|
||||||
|
|
||||||
|
- In package.json, bumped pnpm version from 10.7.0 to 10.10.0 for dependency consistency.
|
||||||
|
- In ts/index.ts, removed redundant type export and now export common types directly.
|
||||||
|
- In ts/smartproxy/classes.smartproxy.ts, reorganized imports and explicitly export IPortProxySettings and IDomainConfig.
|
||||||
|
|
||||||
|
## 2025-05-04 - 10.0.3 - fix(smartproxy)
|
||||||
|
Update dependency versions (@push.rocks/smartacme to ^7.2.4, @push.rocks/smartnetwork to ^4.0.1, ws to ^8.18.2) and export common types via index.ts for easier imports.
|
||||||
|
|
||||||
|
- Upgrade @push.rocks/smartacme from ^7.2.3 to ^7.2.4
|
||||||
|
- Upgrade @push.rocks/smartnetwork from ^4.0.0 to ^4.0.1
|
||||||
|
- Upgrade ws from ^8.18.1 to ^8.18.2
|
||||||
|
- Export common types from ts/common/types.ts in index.ts
|
||||||
|
|
||||||
|
## 2025-05-03 - 10.0.2 - fix(tlsalert)
|
||||||
|
Centralize plugin imports in TlsAlert and update plan checklist
|
||||||
|
|
||||||
|
- Mark the 'Centralize plugin imports in ts/plugins.ts' item as complete in readme.plan.md
|
||||||
|
- Replace direct 'net' imports with a centralized 'plugins' import in ts/smartproxy/classes.pp.tlsalert.ts
|
||||||
|
- Update all socket type references from net.Socket to plugins.net.Socket for consistency
|
||||||
|
|
||||||
|
## 2025-05-03 - 10.0.1 - fix(docs)
|
||||||
|
Improve mermaid diagram formatting in readme.md using HTML <br> tags for line breaks
|
||||||
|
|
||||||
|
- Replaced newline characters with <br> in the SmartProxy Components diagram nodes for better HTML rendering
|
||||||
|
- Improved visual clarity of the architectural diagrams in the readme
|
||||||
|
|
||||||
## 2025-05-03 - 10.0.0 - BREAKING CHANGE(smartproxy)
|
## 2025-05-03 - 10.0.0 - BREAKING CHANGE(smartproxy)
|
||||||
Update documentation and refactor core proxy components; remove legacy performRenewals method from SmartProxy; update router type imports and adjust test suites for improved coverage
|
Update documentation and refactor core proxy components; remove legacy performRenewals method from SmartProxy; update router type imports and adjust test suites for improved coverage
|
||||||
|
|
||||||
|
10
package.json
10
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@push.rocks/smartproxy",
|
"name": "@push.rocks/smartproxy",
|
||||||
"version": "10.0.0",
|
"version": "10.0.7",
|
||||||
"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",
|
||||||
@ -24,9 +24,9 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@push.rocks/lik": "^6.2.2",
|
"@push.rocks/lik": "^6.2.2",
|
||||||
"@push.rocks/smartacme": "^7.2.3",
|
"@push.rocks/smartacme": "^7.2.4",
|
||||||
"@push.rocks/smartdelay": "^3.0.5",
|
"@push.rocks/smartdelay": "^3.0.5",
|
||||||
"@push.rocks/smartnetwork": "^4.0.0",
|
"@push.rocks/smartnetwork": "^4.0.1",
|
||||||
"@push.rocks/smartpromise": "^4.2.3",
|
"@push.rocks/smartpromise": "^4.2.3",
|
||||||
"@push.rocks/smartrequest": "^2.1.0",
|
"@push.rocks/smartrequest": "^2.1.0",
|
||||||
"@push.rocks/smartstring": "^4.0.15",
|
"@push.rocks/smartstring": "^4.0.15",
|
||||||
@ -36,7 +36,7 @@
|
|||||||
"@types/ws": "^8.18.1",
|
"@types/ws": "^8.18.1",
|
||||||
"minimatch": "^10.0.1",
|
"minimatch": "^10.0.1",
|
||||||
"pretty-ms": "^9.2.0",
|
"pretty-ms": "^9.2.0",
|
||||||
"ws": "^8.18.1"
|
"ws": "^8.18.2"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"ts/**/*",
|
"ts/**/*",
|
||||||
@ -86,5 +86,5 @@
|
|||||||
"puppeteer"
|
"puppeteer"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"packageManager": "pnpm@10.7.0+sha512.6b865ad4b62a1d9842b61d674a393903b871d9244954f652b8842c2b553c72176b278f64c463e52d40fff8aba385c235c8c9ecf5cc7de4fd78b8bb6d49633ab6"
|
"packageManager": "pnpm@10.10.0+sha512.d615db246fe70f25dcfea6d8d73dee782ce23e2245e3c4f6f888249fb568149318637dca73c2c5c8ef2a4ca0d5657fb9567188bfab47f566d1ee6ce987815c39"
|
||||||
}
|
}
|
||||||
|
43
pnpm-lock.yaml
generated
43
pnpm-lock.yaml
generated
@ -12,14 +12,14 @@ importers:
|
|||||||
specifier: ^6.2.2
|
specifier: ^6.2.2
|
||||||
version: 6.2.2
|
version: 6.2.2
|
||||||
'@push.rocks/smartacme':
|
'@push.rocks/smartacme':
|
||||||
specifier: ^7.2.3
|
specifier: ^7.2.4
|
||||||
version: 7.2.3(@aws-sdk/credential-providers@3.798.0)(socks@2.8.4)
|
version: 7.2.4(@aws-sdk/credential-providers@3.798.0)(socks@2.8.4)
|
||||||
'@push.rocks/smartdelay':
|
'@push.rocks/smartdelay':
|
||||||
specifier: ^3.0.5
|
specifier: ^3.0.5
|
||||||
version: 3.0.5
|
version: 3.0.5
|
||||||
'@push.rocks/smartnetwork':
|
'@push.rocks/smartnetwork':
|
||||||
specifier: ^4.0.0
|
specifier: ^4.0.1
|
||||||
version: 4.0.0
|
version: 4.0.1
|
||||||
'@push.rocks/smartpromise':
|
'@push.rocks/smartpromise':
|
||||||
specifier: ^4.2.3
|
specifier: ^4.2.3
|
||||||
version: 4.2.3
|
version: 4.2.3
|
||||||
@ -48,8 +48,8 @@ importers:
|
|||||||
specifier: ^9.2.0
|
specifier: ^9.2.0
|
||||||
version: 9.2.0
|
version: 9.2.0
|
||||||
ws:
|
ws:
|
||||||
specifier: ^8.18.1
|
specifier: ^8.18.2
|
||||||
version: 8.18.1
|
version: 8.18.2
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@git.zone/tsbuild':
|
'@git.zone/tsbuild':
|
||||||
specifier: ^2.3.2
|
specifier: ^2.3.2
|
||||||
@ -355,8 +355,8 @@ packages:
|
|||||||
'@cloudflare/workers-types@4.20250303.0':
|
'@cloudflare/workers-types@4.20250303.0':
|
||||||
resolution: {integrity: sha512-O7F7nRT4bbmwHf3gkRBLfJ7R6vHIJ/oZzWdby6obOiw2yavUfp/AIwS7aO2POu5Cv8+h3TXS3oHs3kKCZLraUA==}
|
resolution: {integrity: sha512-O7F7nRT4bbmwHf3gkRBLfJ7R6vHIJ/oZzWdby6obOiw2yavUfp/AIwS7aO2POu5Cv8+h3TXS3oHs3kKCZLraUA==}
|
||||||
|
|
||||||
'@cloudflare/workers-types@4.20250430.0':
|
'@cloudflare/workers-types@4.20250504.0':
|
||||||
resolution: {integrity: sha512-JWAX7ZhQ7KjkdJwASgG58MZ/pQ15brlnZ9/0YBwDQ0hrJ/LaK392aTRFlj2r/PRKDZ5dOuujRywNYaNpfeFiEA==}
|
resolution: {integrity: sha512-/70Kb5vrqj+O0krOuS8LVLiCeDuCGzQy4X+wGGs4/rHv0gZJulv7Uj5YlUjIaRemK/Dyrzlk7WNJwTy8yv0cIw==}
|
||||||
|
|
||||||
'@colors/colors@1.6.0':
|
'@colors/colors@1.6.0':
|
||||||
resolution: {integrity: sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==}
|
resolution: {integrity: sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==}
|
||||||
@ -872,8 +872,8 @@ packages:
|
|||||||
'@push.rocks/qenv@6.1.0':
|
'@push.rocks/qenv@6.1.0':
|
||||||
resolution: {integrity: sha512-1FUFMlSVwFSFg8LbqfkzJ2LLP4lMGApUtgOpsvrde6+AxBmB4gjoNgCUH7z3xXfDAtYqcrtSELXBNE0xVL1MqQ==}
|
resolution: {integrity: sha512-1FUFMlSVwFSFg8LbqfkzJ2LLP4lMGApUtgOpsvrde6+AxBmB4gjoNgCUH7z3xXfDAtYqcrtSELXBNE0xVL1MqQ==}
|
||||||
|
|
||||||
'@push.rocks/smartacme@7.2.3':
|
'@push.rocks/smartacme@7.2.4':
|
||||||
resolution: {integrity: sha512-PTwn/Zf7l+IMWqeiQ8mTxi7fdrtObQH13YzF65si/VxXTqHeZ7zvisLLKZcMEgSaOj1aQ/Ku83gaO8YqO4gDig==}
|
resolution: {integrity: sha512-0ciewRheDAwv0ER0ZyLQVLAn0ZoG1++ibSZ14HoXn8GOTOLyuRLWLNDQL2fI4LtLxeaNYmQUS+f7tt4KaZb/UA==}
|
||||||
|
|
||||||
'@push.rocks/smartarchive@3.0.8':
|
'@push.rocks/smartarchive@3.0.8':
|
||||||
resolution: {integrity: sha512-1jPmR0b7hXmjYQoRiTlRXrIbZcdcFmSdGOfznufjcDpGPe86Km0d8TBnzqghTx4dTihzKC67IxAaz/DM3lvxpA==}
|
resolution: {integrity: sha512-1jPmR0b7hXmjYQoRiTlRXrIbZcdcFmSdGOfznufjcDpGPe86Km0d8TBnzqghTx4dTihzKC67IxAaz/DM3lvxpA==}
|
||||||
@ -974,8 +974,8 @@ packages:
|
|||||||
'@push.rocks/smartnetwork@3.0.2':
|
'@push.rocks/smartnetwork@3.0.2':
|
||||||
resolution: {integrity: sha512-s6CNGzQ1n/d/6cOKXbxeW6/tO//dr1woLqI01g7XhqTriw0nsm2G2kWaZh2J0VOguGNWBgQVCIpR0LjdRNWb3g==}
|
resolution: {integrity: sha512-s6CNGzQ1n/d/6cOKXbxeW6/tO//dr1woLqI01g7XhqTriw0nsm2G2kWaZh2J0VOguGNWBgQVCIpR0LjdRNWb3g==}
|
||||||
|
|
||||||
'@push.rocks/smartnetwork@4.0.0':
|
'@push.rocks/smartnetwork@4.0.1':
|
||||||
resolution: {integrity: sha512-hLE1JNrBjlWtibgFz7t2aMfP15VOfPFyKMpo6FI0JdhmJfD3V5w/nFpSdD6WdXeXUBjCVTJ3C6SrRl8izoG55g==}
|
resolution: {integrity: sha512-zLH88bKY6/cK6vVnCW4Fsugu4T+l6OerWWappit+BecdnQ6vrgShXSAa13JIkkWkWcs4dxEirlEfycQEEQw8BQ==}
|
||||||
|
|
||||||
'@push.rocks/smartnpm@2.0.4':
|
'@push.rocks/smartnpm@2.0.4':
|
||||||
resolution: {integrity: sha512-ljRPqnUsXzL5qnuAEt5POy0NnfKs7eYPuuJPJjYiK9VUdP/CyF4h14qTB4H816vNEuF7VU/ASRtz0qDlXmrztg==}
|
resolution: {integrity: sha512-ljRPqnUsXzL5qnuAEt5POy0NnfKs7eYPuuJPJjYiK9VUdP/CyF4h14qTB4H816vNEuF7VU/ASRtz0qDlXmrztg==}
|
||||||
@ -4622,8 +4622,8 @@ packages:
|
|||||||
utf-8-validate:
|
utf-8-validate:
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
ws@8.18.1:
|
ws@8.18.2:
|
||||||
resolution: {integrity: sha512-RKW2aJZMXeMxVpnZ6bck+RswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+uurzwa0rVI16n/Xzjdz1w==}
|
resolution: {integrity: sha512-DMricUmwGZUVr++AEAe2uiVM7UoO9MAVZMDu05UQOaUII0lp+zOzLLU4Xqh/JvTqklB1T4uELaaPBKyjE1r4fQ==}
|
||||||
engines: {node: '>=10.0.0'}
|
engines: {node: '>=10.0.0'}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
bufferutil: ^4.0.1
|
bufferutil: ^4.0.1
|
||||||
@ -4760,7 +4760,7 @@ snapshots:
|
|||||||
'@api.global/typedrequest': 3.1.10
|
'@api.global/typedrequest': 3.1.10
|
||||||
'@api.global/typedrequest-interfaces': 3.0.19
|
'@api.global/typedrequest-interfaces': 3.0.19
|
||||||
'@api.global/typedsocket': 3.0.1
|
'@api.global/typedsocket': 3.0.1
|
||||||
'@cloudflare/workers-types': 4.20250430.0
|
'@cloudflare/workers-types': 4.20250504.0
|
||||||
'@design.estate/dees-comms': 1.0.27
|
'@design.estate/dees-comms': 1.0.27
|
||||||
'@push.rocks/lik': 6.2.2
|
'@push.rocks/lik': 6.2.2
|
||||||
'@push.rocks/smartchok': 1.0.34
|
'@push.rocks/smartchok': 1.0.34
|
||||||
@ -5671,7 +5671,7 @@ snapshots:
|
|||||||
|
|
||||||
'@cloudflare/workers-types@4.20250303.0': {}
|
'@cloudflare/workers-types@4.20250303.0': {}
|
||||||
|
|
||||||
'@cloudflare/workers-types@4.20250430.0': {}
|
'@cloudflare/workers-types@4.20250504.0': {}
|
||||||
|
|
||||||
'@colors/colors@1.6.0': {}
|
'@colors/colors@1.6.0': {}
|
||||||
|
|
||||||
@ -5950,7 +5950,7 @@ snapshots:
|
|||||||
'@push.rocks/tapbundle': 5.6.3(@aws-sdk/credential-providers@3.798.0)(socks@2.8.4)
|
'@push.rocks/tapbundle': 5.6.3(@aws-sdk/credential-providers@3.798.0)(socks@2.8.4)
|
||||||
'@types/ws': 8.18.1
|
'@types/ws': 8.18.1
|
||||||
figures: 6.1.0
|
figures: 6.1.0
|
||||||
ws: 8.18.1
|
ws: 8.18.2
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- '@aws-sdk/credential-providers'
|
- '@aws-sdk/credential-providers'
|
||||||
- '@mongodb-js/zstd'
|
- '@mongodb-js/zstd'
|
||||||
@ -6284,7 +6284,7 @@ snapshots:
|
|||||||
'@push.rocks/smartlog': 3.0.7
|
'@push.rocks/smartlog': 3.0.7
|
||||||
'@push.rocks/smartpath': 5.0.18
|
'@push.rocks/smartpath': 5.0.18
|
||||||
|
|
||||||
'@push.rocks/smartacme@7.2.3(@aws-sdk/credential-providers@3.798.0)(socks@2.8.4)':
|
'@push.rocks/smartacme@7.2.4(@aws-sdk/credential-providers@3.798.0)(socks@2.8.4)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@api.global/typedserver': 3.0.74
|
'@api.global/typedserver': 3.0.74
|
||||||
'@apiclient.xyz/cloudflare': 6.4.1
|
'@apiclient.xyz/cloudflare': 6.4.1
|
||||||
@ -6304,6 +6304,7 @@ snapshots:
|
|||||||
- '@aws-sdk/credential-providers'
|
- '@aws-sdk/credential-providers'
|
||||||
- '@mongodb-js/zstd'
|
- '@mongodb-js/zstd'
|
||||||
- '@nuxt/kit'
|
- '@nuxt/kit'
|
||||||
|
- aws-crt
|
||||||
- bufferutil
|
- bufferutil
|
||||||
- encoding
|
- encoding
|
||||||
- gcp-metadata
|
- gcp-metadata
|
||||||
@ -6605,7 +6606,7 @@ snapshots:
|
|||||||
public-ip: 6.0.2
|
public-ip: 6.0.2
|
||||||
systeminformation: 5.25.11
|
systeminformation: 5.25.11
|
||||||
|
|
||||||
'@push.rocks/smartnetwork@4.0.0':
|
'@push.rocks/smartnetwork@4.0.1':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@push.rocks/smartping': 1.0.8
|
'@push.rocks/smartping': 1.0.8
|
||||||
'@push.rocks/smartpromise': 4.2.3
|
'@push.rocks/smartpromise': 4.2.3
|
||||||
@ -10544,7 +10545,7 @@ snapshots:
|
|||||||
debug: 4.4.0
|
debug: 4.4.0
|
||||||
devtools-protocol: 0.0.1413902
|
devtools-protocol: 0.0.1413902
|
||||||
typed-query-selector: 2.12.0
|
typed-query-selector: 2.12.0
|
||||||
ws: 8.18.1
|
ws: 8.18.2
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- bare-buffer
|
- bare-buffer
|
||||||
- bufferutil
|
- bufferutil
|
||||||
@ -11303,7 +11304,7 @@ snapshots:
|
|||||||
|
|
||||||
ws@8.17.1: {}
|
ws@8.17.1: {}
|
||||||
|
|
||||||
ws@8.18.1: {}
|
ws@8.18.2: {}
|
||||||
|
|
||||||
xml-js@1.6.11:
|
xml-js@1.6.11:
|
||||||
dependencies:
|
dependencies:
|
||||||
|
@ -180,12 +180,12 @@ flowchart TB
|
|||||||
|
|
||||||
subgraph "SmartProxy Components"
|
subgraph "SmartProxy Components"
|
||||||
direction TB
|
direction TB
|
||||||
HTTP80[HTTP Port 80\nRedirect / SslRedirect]
|
HTTP80["HTTP Port 80<br>Redirect / SslRedirect"]
|
||||||
HTTPS443[HTTPS Port 443\nNetworkProxy]
|
HTTPS443["HTTPS Port 443<br>NetworkProxy"]
|
||||||
SmartProxy[SmartProxy\n(TCP/SNI Proxy)]
|
SmartProxy["SmartProxy<br>(TCP/SNI Proxy)"]
|
||||||
NfTables[NfTablesProxy]
|
NfTables[NfTablesProxy]
|
||||||
Router[ProxyRouter]
|
Router[ProxyRouter]
|
||||||
ACME[Port80Handler\n(ACME HTTP-01)]
|
ACME["Port80Handler<br>(ACME HTTP-01)"]
|
||||||
Certs[(SSL Certificates)]
|
Certs[(SSL Certificates)]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ This document outlines a roadmap to simplify and refactor the SmartProxy & Netwo
|
|||||||
- [x] Unify configuration options:
|
- [x] Unify configuration options:
|
||||||
- [x] Merge `INetworkProxyOptions.acme`, `IPort80HandlerOptions`, and `port80HandlerConfig` into one schema
|
- [x] Merge `INetworkProxyOptions.acme`, `IPort80HandlerOptions`, and `port80HandlerConfig` into one schema
|
||||||
- [x] Deprecate old option names and provide clear upgrade path
|
- [x] Deprecate old option names and provide clear upgrade path
|
||||||
- [ ] Centralize plugin imports in `ts/plugins.ts` and update all modules to use it
|
- [x] Centralize plugin imports in `ts/plugins.ts` and update all modules to use it
|
||||||
- [x] Remove legacy or unused code paths (e.g., old HTTP/2 fallback logic if obsolete)
|
- [x] Remove legacy or unused code paths (e.g., old HTTP/2 fallback logic if obsolete)
|
||||||
- [ ] Enhance and expand test coverage:
|
- [ ] Enhance and expand test coverage:
|
||||||
- Add unit tests for certificate issuance, renewal, and error handling
|
- Add unit tests for certificate issuance, renewal, and error handling
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@push.rocks/smartproxy',
|
name: '@push.rocks/smartproxy',
|
||||||
version: '10.0.0',
|
version: '10.0.7',
|
||||||
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.'
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import * as plugins from '../plugins.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shared types for certificate management and domain options
|
* Shared types for certificate management and domain options
|
||||||
*/
|
*/
|
||||||
@ -86,4 +88,4 @@ export interface IAcmeOptions {
|
|||||||
certificateStore?: string; // Directory to store certificates
|
certificateStore?: string; // Directory to store certificates
|
||||||
skipConfiguredCerts?: boolean; // Skip domains with existing certificates
|
skipConfiguredCerts?: boolean; // Skip domains with existing certificates
|
||||||
domainForwards?: IDomainForwardConfig[]; // Domain-specific forwarding configs
|
domainForwards?: IDomainForwardConfig[]; // Domain-specific forwarding configs
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
export * from './nfttablesproxy/classes.nftablesproxy.js';
|
export * from './nfttablesproxy/classes.nftablesproxy.js';
|
||||||
export * from './networkproxy/classes.np.networkproxy.js';
|
export * from './networkproxy/index.js';
|
||||||
export * from './port80handler/classes.port80handler.js';
|
export * from './port80handler/classes.port80handler.js';
|
||||||
export * from './redirect/classes.redirect.js';
|
export * from './redirect/classes.redirect.js';
|
||||||
export * from './smartproxy/classes.smartproxy.js';
|
export * from './smartproxy/classes.smartproxy.js';
|
||||||
export * from './smartproxy/classes.pp.snihandler.js';
|
export * from './smartproxy/classes.pp.snihandler.js';
|
||||||
export * from './smartproxy/classes.pp.interfaces.js';
|
export * from './smartproxy/classes.pp.interfaces.js';
|
||||||
|
|
||||||
|
export * from './common/types.js';
|
||||||
|
@ -2,7 +2,7 @@ import * as plugins from '../plugins.js';
|
|||||||
import type {
|
import type {
|
||||||
IConnectionRecord,
|
IConnectionRecord,
|
||||||
IDomainConfig,
|
IDomainConfig,
|
||||||
IPortProxySettings,
|
ISmartProxyOptions,
|
||||||
} from './classes.pp.interfaces.js';
|
} from './classes.pp.interfaces.js';
|
||||||
import { ConnectionManager } from './classes.pp.connectionmanager.js';
|
import { ConnectionManager } from './classes.pp.connectionmanager.js';
|
||||||
import { SecurityManager } from './classes.pp.securitymanager.js';
|
import { SecurityManager } from './classes.pp.securitymanager.js';
|
||||||
@ -17,7 +17,7 @@ import { PortRangeManager } from './classes.pp.portrangemanager.js';
|
|||||||
*/
|
*/
|
||||||
export class ConnectionHandler {
|
export class ConnectionHandler {
|
||||||
constructor(
|
constructor(
|
||||||
private settings: IPortProxySettings,
|
private settings: ISmartProxyOptions,
|
||||||
private connectionManager: ConnectionManager,
|
private connectionManager: ConnectionManager,
|
||||||
private securityManager: SecurityManager,
|
private securityManager: SecurityManager,
|
||||||
private domainConfigManager: DomainConfigManager,
|
private domainConfigManager: DomainConfigManager,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import * as plugins from '../plugins.js';
|
import * as plugins from '../plugins.js';
|
||||||
import type { IConnectionRecord, IPortProxySettings } from './classes.pp.interfaces.js';
|
import type { IConnectionRecord, ISmartProxyOptions } from './classes.pp.interfaces.js';
|
||||||
import { SecurityManager } from './classes.pp.securitymanager.js';
|
import { SecurityManager } from './classes.pp.securitymanager.js';
|
||||||
import { TimeoutManager } from './classes.pp.timeoutmanager.js';
|
import { TimeoutManager } from './classes.pp.timeoutmanager.js';
|
||||||
|
|
||||||
@ -14,7 +14,7 @@ export class ConnectionManager {
|
|||||||
} = { incoming: {}, outgoing: {} };
|
} = { incoming: {}, outgoing: {} };
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private settings: IPortProxySettings,
|
private settings: ISmartProxyOptions,
|
||||||
private securityManager: SecurityManager,
|
private securityManager: SecurityManager,
|
||||||
private timeoutManager: TimeoutManager
|
private timeoutManager: TimeoutManager
|
||||||
) {}
|
) {}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import * as plugins from '../plugins.js';
|
import * as plugins from '../plugins.js';
|
||||||
import type { IDomainConfig, IPortProxySettings } from './classes.pp.interfaces.js';
|
import type { IDomainConfig, ISmartProxyOptions } from './classes.pp.interfaces.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manages domain configurations and target selection
|
* Manages domain configurations and target selection
|
||||||
@ -8,7 +8,7 @@ export class DomainConfigManager {
|
|||||||
// Track round-robin indices for domain configs
|
// Track round-robin indices for domain configs
|
||||||
private domainTargetIndices: Map<IDomainConfig, number> = new Map();
|
private domainTargetIndices: Map<IDomainConfig, number> = new Map();
|
||||||
|
|
||||||
constructor(private settings: IPortProxySettings) {}
|
constructor(private settings: ISmartProxyOptions) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the domain configurations
|
* Updates the domain configurations
|
||||||
|
@ -22,7 +22,7 @@ export interface IDomainConfig {
|
|||||||
|
|
||||||
/** Port proxy settings including global allowed port ranges */
|
/** Port proxy settings including global allowed port ranges */
|
||||||
import type { IAcmeOptions } from '../common/types.js';
|
import type { IAcmeOptions } from '../common/types.js';
|
||||||
export interface IPortProxySettings {
|
export interface ISmartProxyOptions {
|
||||||
fromPort: number;
|
fromPort: number;
|
||||||
toPort: number;
|
toPort: number;
|
||||||
targetIP?: string; // Global target host to proxy to, defaults to 'localhost'
|
targetIP?: string; // Global target host to proxy to, defaults to 'localhost'
|
||||||
|
@ -4,7 +4,7 @@ import { Port80Handler } from '../port80handler/classes.port80handler.js';
|
|||||||
import { Port80HandlerEvents } from '../common/types.js';
|
import { Port80HandlerEvents } from '../common/types.js';
|
||||||
import { subscribeToPort80Handler } from '../common/eventUtils.js';
|
import { subscribeToPort80Handler } from '../common/eventUtils.js';
|
||||||
import type { ICertificateData } from '../common/types.js';
|
import type { ICertificateData } from '../common/types.js';
|
||||||
import type { IConnectionRecord, IPortProxySettings, IDomainConfig } from './classes.pp.interfaces.js';
|
import type { IConnectionRecord, ISmartProxyOptions, IDomainConfig } from './classes.pp.interfaces.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manages NetworkProxy integration for TLS termination
|
* Manages NetworkProxy integration for TLS termination
|
||||||
@ -13,7 +13,7 @@ export class NetworkProxyBridge {
|
|||||||
private networkProxy: NetworkProxy | null = null;
|
private networkProxy: NetworkProxy | null = null;
|
||||||
private port80Handler: Port80Handler | null = null;
|
private port80Handler: Port80Handler | null = null;
|
||||||
|
|
||||||
constructor(private settings: IPortProxySettings) {}
|
constructor(private settings: ISmartProxyOptions) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the Port80Handler to use for certificate management
|
* Set the Port80Handler to use for certificate management
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import type{ IPortProxySettings } from './classes.pp.interfaces.js';
|
import type{ ISmartProxyOptions } from './classes.pp.interfaces.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manages port ranges and port-based configuration
|
* Manages port ranges and port-based configuration
|
||||||
*/
|
*/
|
||||||
export class PortRangeManager {
|
export class PortRangeManager {
|
||||||
constructor(private settings: IPortProxySettings) {}
|
constructor(private settings: ISmartProxyOptions) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all ports that should be listened on
|
* Get all ports that should be listened on
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import * as plugins from '../plugins.js';
|
import * as plugins from '../plugins.js';
|
||||||
import type { IPortProxySettings } from './classes.pp.interfaces.js';
|
import type { ISmartProxyOptions } from './classes.pp.interfaces.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles security aspects like IP tracking, rate limiting, and authorization
|
* Handles security aspects like IP tracking, rate limiting, and authorization
|
||||||
@ -8,7 +8,7 @@ export class SecurityManager {
|
|||||||
private connectionsByIP: Map<string, Set<string>> = new Map();
|
private connectionsByIP: Map<string, Set<string>> = new Map();
|
||||||
private connectionRateByIP: Map<string, number[]> = new Map();
|
private connectionRateByIP: Map<string, number[]> = new Map();
|
||||||
|
|
||||||
constructor(private settings: IPortProxySettings) {}
|
constructor(private settings: ISmartProxyOptions) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get connections count by IP
|
* Get connections count by IP
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import type { IConnectionRecord, IPortProxySettings } from './classes.pp.interfaces.js';
|
import type { IConnectionRecord, ISmartProxyOptions } from './classes.pp.interfaces.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manages timeouts and inactivity tracking for connections
|
* Manages timeouts and inactivity tracking for connections
|
||||||
*/
|
*/
|
||||||
export class TimeoutManager {
|
export class TimeoutManager {
|
||||||
constructor(private settings: IPortProxySettings) {}
|
constructor(private settings: ISmartProxyOptions) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ensure timeout values don't exceed Node.js max safe integer
|
* Ensure timeout values don't exceed Node.js max safe integer
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import * as net from 'net';
|
import * as plugins from '../plugins.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TlsAlert class for managing TLS alert messages
|
* TlsAlert class for managing TLS alert messages
|
||||||
@ -99,7 +99,7 @@ export class TlsAlert {
|
|||||||
* @returns Promise that resolves when the alert has been sent
|
* @returns Promise that resolves when the alert has been sent
|
||||||
*/
|
*/
|
||||||
static async send(
|
static async send(
|
||||||
socket: net.Socket,
|
socket: plugins.net.Socket,
|
||||||
level: number,
|
level: number,
|
||||||
description: number,
|
description: number,
|
||||||
closeAfterSend: boolean = false,
|
closeAfterSend: boolean = false,
|
||||||
@ -183,7 +183,7 @@ export class TlsAlert {
|
|||||||
* @param socket The socket to send the alert to
|
* @param socket The socket to send the alert to
|
||||||
* @returns Promise that resolves when the alert has been sent
|
* @returns Promise that resolves when the alert has been sent
|
||||||
*/
|
*/
|
||||||
static async sendSniRequired(socket: net.Socket): Promise<void> {
|
static async sendSniRequired(socket: plugins.net.Socket): Promise<void> {
|
||||||
return this.send(socket, this.LEVEL_WARNING, this.UNRECOGNIZED_NAME);
|
return this.send(socket, this.LEVEL_WARNING, this.UNRECOGNIZED_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -194,7 +194,7 @@ export class TlsAlert {
|
|||||||
* @param closeDelay Milliseconds to wait before closing the connection (default: 200ms)
|
* @param closeDelay Milliseconds to wait before closing the connection (default: 200ms)
|
||||||
* @returns Promise that resolves when the alert has been sent and the connection closed
|
* @returns Promise that resolves when the alert has been sent and the connection closed
|
||||||
*/
|
*/
|
||||||
static async sendCloseNotify(socket: net.Socket, closeDelay: number = 200): Promise<void> {
|
static async sendCloseNotify(socket: plugins.net.Socket, closeDelay: number = 200): Promise<void> {
|
||||||
return this.send(socket, this.LEVEL_WARNING, this.CLOSE_NOTIFY, true, closeDelay);
|
return this.send(socket, this.LEVEL_WARNING, this.CLOSE_NOTIFY, true, closeDelay);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,7 +208,7 @@ export class TlsAlert {
|
|||||||
* @returns Promise that resolves when the alert has been sent
|
* @returns Promise that resolves when the alert has been sent
|
||||||
*/
|
*/
|
||||||
static async sendCertificateExpired(
|
static async sendCertificateExpired(
|
||||||
socket: net.Socket,
|
socket: plugins.net.Socket,
|
||||||
fatal: boolean = false,
|
fatal: boolean = false,
|
||||||
closeAfterSend: boolean = true,
|
closeAfterSend: boolean = true,
|
||||||
closeDelay: number = 200
|
closeDelay: number = 200
|
||||||
@ -224,7 +224,7 @@ export class TlsAlert {
|
|||||||
* @param socket The socket to send the alerts to
|
* @param socket The socket to send the alerts to
|
||||||
* @returns Promise that resolves when all alerts have been sent
|
* @returns Promise that resolves when all alerts have been sent
|
||||||
*/
|
*/
|
||||||
static async sendForceSniSequence(socket: net.Socket): Promise<void> {
|
static async sendForceSniSequence(socket: plugins.net.Socket): Promise<void> {
|
||||||
try {
|
try {
|
||||||
// Send unrecognized_name (warning)
|
// Send unrecognized_name (warning)
|
||||||
socket.cork();
|
socket.cork();
|
||||||
@ -249,7 +249,7 @@ export class TlsAlert {
|
|||||||
* @returns Promise that resolves when the alert has been sent and the connection closed
|
* @returns Promise that resolves when the alert has been sent and the connection closed
|
||||||
*/
|
*/
|
||||||
static async sendFatalAndClose(
|
static async sendFatalAndClose(
|
||||||
socket: net.Socket,
|
socket: plugins.net.Socket,
|
||||||
description: number,
|
description: number,
|
||||||
closeDelay: number = 100
|
closeDelay: number = 100
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import * as plugins from '../plugins.js';
|
import * as plugins from '../plugins.js';
|
||||||
import type { IPortProxySettings } from './classes.pp.interfaces.js';
|
import type { ISmartProxyOptions } from './classes.pp.interfaces.js';
|
||||||
import { SniHandler } from './classes.pp.snihandler.js';
|
import { SniHandler } from './classes.pp.snihandler.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -16,7 +16,7 @@ interface IConnectionInfo {
|
|||||||
* Manages TLS-related operations including SNI extraction and validation
|
* Manages TLS-related operations including SNI extraction and validation
|
||||||
*/
|
*/
|
||||||
export class TlsManager {
|
export class TlsManager {
|
||||||
constructor(private settings: IPortProxySettings) {}
|
constructor(private settings: ISmartProxyOptions) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a data chunk appears to be a TLS handshake
|
* Check if a data chunk appears to be a TLS handshake
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import * as plugins from '../plugins.js';
|
import * as plugins from '../plugins.js';
|
||||||
import type { IPortProxySettings, IDomainConfig } from './classes.pp.interfaces.js';
|
|
||||||
import { ConnectionManager } from './classes.pp.connectionmanager.js';
|
import { ConnectionManager } from './classes.pp.connectionmanager.js';
|
||||||
import { SecurityManager } from './classes.pp.securitymanager.js';
|
import { SecurityManager } from './classes.pp.securitymanager.js';
|
||||||
import { DomainConfigManager } from './classes.pp.domainconfigmanager.js';
|
import { DomainConfigManager } from './classes.pp.domainconfigmanager.js';
|
||||||
@ -13,6 +13,9 @@ import { CertProvisioner } from './classes.pp.certprovisioner.js';
|
|||||||
import type { ICertificateData } from '../common/types.js';
|
import type { ICertificateData } from '../common/types.js';
|
||||||
import { buildPort80Handler } from '../common/acmeFactory.js';
|
import { buildPort80Handler } from '../common/acmeFactory.js';
|
||||||
|
|
||||||
|
import type { ISmartProxyOptions, IDomainConfig } from './classes.pp.interfaces.js';
|
||||||
|
export type { ISmartProxyOptions as IPortProxySettings, IDomainConfig };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SmartProxy - Main class that coordinates all components
|
* SmartProxy - Main class that coordinates all components
|
||||||
*/
|
*/
|
||||||
@ -36,7 +39,7 @@ export class SmartProxy extends plugins.EventEmitter {
|
|||||||
// CertProvisioner for unified certificate workflows
|
// CertProvisioner for unified certificate workflows
|
||||||
private certProvisioner?: CertProvisioner;
|
private certProvisioner?: CertProvisioner;
|
||||||
|
|
||||||
constructor(settingsArg: IPortProxySettings) {
|
constructor(settingsArg: ISmartProxyOptions) {
|
||||||
super();
|
super();
|
||||||
// Set reasonable defaults for all settings
|
// Set reasonable defaults for all settings
|
||||||
this.settings = {
|
this.settings = {
|
||||||
@ -116,7 +119,7 @@ export class SmartProxy extends plugins.EventEmitter {
|
|||||||
/**
|
/**
|
||||||
* The settings for the port proxy
|
* The settings for the port proxy
|
||||||
*/
|
*/
|
||||||
public settings: IPortProxySettings;
|
public settings: ISmartProxyOptions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the Port80Handler for ACME certificate management
|
* Initialize the Port80Handler for ACME certificate management
|
||||||
|
Reference in New Issue
Block a user