fix(smartproxy): Improve port binding intelligence and ACME challenge route management; update route configuration tests and dependency versions.
This commit is contained in:
@ -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();
|
||||
|
Reference in New Issue
Block a user