fix(core): use node: scoped builtin imports and add route unit tests

This commit is contained in:
2026-02-11 13:48:30 +00:00
parent a9fe365c78
commit 5019658032
14 changed files with 7591 additions and 18 deletions

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartproxy',
version: '23.1.1',
version: '23.1.2',
description: 'A powerful proxy package with unified route-based configuration for high traffic management. Features include SSL/TLS support, flexible routing patterns, WebSocket handling, advanced security options, and automatic ACME certificate management.'
}

View File

@@ -1,4 +1,4 @@
import * as net from 'net';
import * as net from 'node:net';
import { WrappedSocket } from './wrapped-socket.js';
/**

View File

@@ -1,7 +1,7 @@
import { LifecycleComponent } from './lifecycle-component.js';
import { BinaryHeap } from './binary-heap.js';
import { AsyncMutex } from './async-utils.js';
import { EventEmitter } from 'events';
import { EventEmitter } from 'node:events';
/**
* Interface for pooled connection

View File

@@ -3,7 +3,7 @@
* Provides standardized socket cleanup with proper listener and timer management
*/
import type { Socket } from 'net';
import type { Socket } from 'node:net';
export type SocketTracked = {
cleanup: () => void;

View File

@@ -1,13 +1,13 @@
// node native scope
import { EventEmitter } from 'events';
import * as fs from 'fs';
import * as http from 'http';
import * as https from 'https';
import * as net from 'net';
import * as path from 'path';
import * as tls from 'tls';
import * as url from 'url';
import * as http2 from 'http2';
import { EventEmitter } from 'node:events';
import * as fs from 'node:fs';
import * as http from 'node:http';
import * as https from 'node:https';
import * as net from 'node:net';
import * as path from 'node:path';
import * as tls from 'node:tls';
import * as url from 'node:url';
import * as http2 from 'node:http2';
export { EventEmitter, fs, http, https, net, path, tls, url, http2 };

View File

@@ -5,7 +5,7 @@
* that may span multiple TCP packets.
*/
import { Buffer } from 'buffer';
import { Buffer } from 'node:buffer';
/**
* Fragment tracking information

View File

@@ -1,4 +1,4 @@
import { Buffer } from 'buffer';
import { Buffer } from 'node:buffer';
import {
TlsRecordType,
TlsHandshakeType,

View File

@@ -1,4 +1,4 @@
import { Buffer } from 'buffer';
import { Buffer } from 'node:buffer';
import { TlsExtensionType, TlsUtils } from '../utils/tls-utils.js';
import {
ClientHelloParser,

View File

@@ -2,7 +2,7 @@
* WebSocket Protocol Utilities
*/
import * as crypto from 'crypto';
import * as crypto from 'node:crypto';
import { WEBSOCKET_MAGIC_STRING } from './constants.js';
import type { RawData } from './types.js';

View File

@@ -1,4 +1,4 @@
import { Buffer } from 'buffer';
import { Buffer } from 'node:buffer';
import {
TlsRecordType,
TlsHandshakeType,