Compare commits

...

4 Commits

Author SHA1 Message Date
73f3dfcad4 10.0.2
Some checks failed
Default (tags) / security (push) Successful in 42s
Default (tags) / test (push) Failing after 1m18s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-05-03 19:02:26 +00:00
8291f1f33a fix(tlsalert): Centralize plugin imports in TlsAlert and update plan checklist 2025-05-03 19:02:26 +00:00
f512fb4252 10.0.1
Some checks failed
Default (tags) / security (push) Successful in 37s
Default (tags) / test (push) Failing after 1m18s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-05-03 13:27:59 +00:00
1f3ee1eafc fix(docs): Improve mermaid diagram formatting in readme.md using HTML <br> tags for line breaks 2025-05-03 13:27:59 +00:00
6 changed files with 27 additions and 14 deletions

View File

@ -1,5 +1,18 @@
# Changelog # Changelog
## 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

View File

@ -1,6 +1,6 @@
{ {
"name": "@push.rocks/smartproxy", "name": "@push.rocks/smartproxy",
"version": "10.0.0", "version": "10.0.2",
"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",

View File

@ -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

View File

@ -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

View File

@ -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.2',
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.'
} }

View File

@ -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> {