fix(smartproxy): Improve port binding intelligence and ACME challenge route management; update route configuration tests and dependency versions.

This commit is contained in:
2025-05-28 19:58:28 +00:00
parent 4ebaf6c061
commit 742adc2bd9
17 changed files with 948 additions and 1258 deletions

View File

@ -1,4 +1,4 @@
import { expect, tap } from '@git.zone/tapbundle';
import { expect, tap } from '@git.zone/tstest/tapbundle';
import * as net from 'net';
import { SmartProxy } from '../ts/proxies/smart-proxy/smart-proxy.js';
@ -35,7 +35,7 @@ tap.test('forward connections should not be immediately closed', async (t) => {
id: 'forward-test',
name: 'Forward Test Route',
match: {
port: 8080,
ports: 8080,
},
action: {
type: 'forward',
@ -80,9 +80,15 @@ tap.test('forward connections should not be immediately closed', async (t) => {
});
// Wait for the welcome message
await t.waitForExpect(() => {
return dataReceived;
}, 'Data should be received from the server', 2000);
let waitTime = 0;
while (!dataReceived && waitTime < 2000) {
await new Promise(resolve => setTimeout(resolve, 100));
waitTime += 100;
}
if (!dataReceived) {
throw new Error('Data should be received from the server');
}
// Verify we got the welcome message
expect(welcomeMessage).toContain('Welcome from test server');
@ -94,7 +100,7 @@ tap.test('forward connections should not be immediately closed', async (t) => {
await new Promise(resolve => setTimeout(resolve, 100));
// Connection should still be open
expect(connectionClosed).toBe(false);
expect(connectionClosed).toEqual(false);
// Clean up
client.end();