fix(smartproxy): upgrade @push.rocks/smartproxy to ^23.1.0 and adapt code/tests for its async getStatistics() API

This commit is contained in:
2026-02-10 14:41:19 +00:00
parent 9d7da5bc25
commit e375adb80a
11 changed files with 196 additions and 94 deletions

View File

@@ -15,7 +15,8 @@ tap.test('should use traditional port forwarding when useSocketHandler is false'
},
smartProxyConfig: {
routes: []
}
},
cacheConfig: { enabled: false }
});
await dcRouter.start();
@@ -51,7 +52,8 @@ tap.test('should use socket-handler mode when useSocketHandler is true', async (
},
smartProxyConfig: {
routes: []
}
},
cacheConfig: { enabled: false }
});
await dcRouter.start();
@@ -85,7 +87,7 @@ tap.test('should generate correct email routes for each port', async () => {
useSocketHandler: true
};
dcRouter = new DcRouter({ emailConfig });
dcRouter = new DcRouter({ emailConfig, cacheConfig: { enabled: false } });
// Access the private method to generate routes
const emailRoutes = (dcRouter as any).generateEmailRoutes(emailConfig);
@@ -119,7 +121,8 @@ tap.test('email socket handler should handle different ports correctly', async (
domains: ['test.local'],
routes: [],
useSocketHandler: true
}
},
cacheConfig: { enabled: false }
});
await dcRouter.start();
@@ -145,7 +148,8 @@ tap.test('email server handleSocket method should work', async () => {
domains: ['test.local'],
routes: [],
useSocketHandler: true
}
},
cacheConfig: { enabled: false }
});
await dcRouter.start();
@@ -182,11 +186,12 @@ tap.test('should not create SMTP servers when useSocketHandler is true', async (
domains: ['test.local'],
routes: [],
useSocketHandler: true
}
},
cacheConfig: { enabled: false }
});
await dcRouter.start();
// The email server should not have any SMTP server instances
const emailServer = (dcRouter as any).emailServer;
expect(emailServer).toBeDefined();
@@ -209,7 +214,7 @@ tap.test('TLS handling should differ between ports', async () => {
useSocketHandler: false // Use traditional mode to check TLS config
};
dcRouter = new DcRouter({ emailConfig });
dcRouter = new DcRouter({ emailConfig, cacheConfig: { enabled: false } });
const emailRoutes = (dcRouter as any).generateEmailRoutes(emailConfig);