fix(smartproxy): improve certificate manager mocking in tests, enhance IPv6 validation, and record initial bytes for connection metrics

This commit is contained in:
2026-01-30 19:52:36 +00:00
parent 1d1e5062a6
commit 2068b7a1ad
15 changed files with 230 additions and 119 deletions

View File

@@ -68,6 +68,7 @@ tap.test('setup port proxy test environment', async () => {
smartProxy = new SmartProxy({
routes: [
{
name: 'test-proxy-route',
match: {
ports: PROXY_PORT
},
@@ -107,6 +108,7 @@ tap.test('should forward TCP connections to custom host', async () => {
const customHostProxy = new SmartProxy({
routes: [
{
name: 'custom-host-route',
match: {
ports: PROXY_PORT + 1
},
@@ -152,6 +154,7 @@ tap.test('should forward connections to custom IP', async () => {
const domainProxy = new SmartProxy({
routes: [
{
name: 'domain-proxy-route',
match: {
ports: forcedProxyPort
},
@@ -247,6 +250,7 @@ tap.test('should support optional source IP preservation in chained proxies', as
const firstProxyDefault = new SmartProxy({
routes: [
{
name: 'first-proxy-default-route',
match: {
ports: PROXY_PORT + 4
},
@@ -268,6 +272,7 @@ tap.test('should support optional source IP preservation in chained proxies', as
const secondProxyDefault = new SmartProxy({
routes: [
{
name: 'second-proxy-default-route',
match: {
ports: PROXY_PORT + 5
},
@@ -306,6 +311,7 @@ tap.test('should support optional source IP preservation in chained proxies', as
const firstProxyPreserved = new SmartProxy({
routes: [
{
name: 'first-proxy-preserved-route',
match: {
ports: PROXY_PORT + 6
},
@@ -329,6 +335,7 @@ tap.test('should support optional source IP preservation in chained proxies', as
const secondProxyPreserved = new SmartProxy({
routes: [
{
name: 'second-proxy-preserved-route',
match: {
ports: PROXY_PORT + 7
},
@@ -371,6 +378,7 @@ tap.test('should use round robin for multiple target hosts in domain config', as
// Create a domain config with multiple hosts in the target
// Create a route with multiple target hosts
const routeConfig = {
name: 'round-robin-route',
match: {
ports: 80,
domains: ['rr.test']