This commit is contained in:
Juergen Kunz
2025-07-17 15:34:58 +00:00
parent 82df9a6f52
commit b26abbfd87
7 changed files with 38 additions and 37 deletions

View File

@@ -247,7 +247,8 @@ export interface IRouteAction {
type: TRouteActionType;
// Targets for forwarding (array supports multiple targets with sub-matching)
targets: IRouteTarget[];
// Required for 'forward' action type
targets?: IRouteTarget[];
// TLS handling (default for all targets, can be overridden per target)
tls?: IRouteTls;

View File

@@ -922,7 +922,7 @@ export class RouteConnectionHandler {
routeContext.targetHost = selectedHost;
// Get effective settings (target overrides route-level settings)
const effectiveTls = selectedTarget.tls || effectiveTls;
const effectiveTls = selectedTarget.tls || action.tls;
const effectiveWebsocket = selectedTarget.websocket || action.websocket;
const effectiveSendProxyProtocol = selectedTarget.sendProxyProtocol !== undefined
? selectedTarget.sendProxyProtocol

View File

@@ -42,7 +42,7 @@ export function createHttpRoute(
// Create route action
const action: IRouteAction = {
type: 'forward',
target
targets: [target]
};
// Create the route config
@@ -82,7 +82,7 @@ export function createHttpsTerminateRoute(
// Create route action
const action: IRouteAction = {
type: 'forward',
target,
targets: [target],
tls: {
mode: options.reencrypt ? 'terminate-and-reencrypt' : 'terminate',
certificate: options.certificate || 'auto'
@@ -152,7 +152,7 @@ export function createHttpsPassthroughRoute(
// Create route action
const action: IRouteAction = {
type: 'forward',
target,
targets: [target],
tls: {
mode: 'passthrough'
}
@@ -243,7 +243,7 @@ export function createLoadBalancerRoute(
// Create route action
const action: IRouteAction = {
type: 'forward',
target
targets: [target]
};
// Add TLS configuration if provided
@@ -303,7 +303,7 @@ export function createApiRoute(
// Create route action
const action: IRouteAction = {
type: 'forward',
target
targets: [target]
};
// Add TLS configuration if using HTTPS
@@ -374,7 +374,7 @@ export function createWebSocketRoute(
// Create route action
const action: IRouteAction = {
type: 'forward',
target,
targets: [target],
websocket: {
enabled: true,
pingInterval: options.pingInterval || 30000, // 30 seconds
@@ -432,10 +432,10 @@ export function createPortMappingRoute(options: {
// Create route action
const action: IRouteAction = {
type: 'forward',
target: {
targets: [{
host: options.targetHost,
port: options.portMapper
}
}]
};
// Create the route config
@@ -500,10 +500,10 @@ export function createDynamicRoute(options: {
// Create route action
const action: IRouteAction = {
type: 'forward',
target: {
targets: [{
host: options.targetHost,
port: options.portMapper
}
}]
};
// Create the route config
@@ -548,10 +548,10 @@ export function createSmartLoadBalancer(options: {
// Create route action
const action: IRouteAction = {
type: 'forward',
target: {
targets: [{
host: hostSelector,
port: options.portMapper
}
}]
};
// Create the route config
@@ -609,10 +609,10 @@ export function createNfTablesRoute(
// Create route action
const action: IRouteAction = {
type: 'forward',
target: {
targets: [{
host: target.host,
port: target.port
},
}],
forwardingEngine: 'nftables',
nftables: {
protocol: options.protocol || 'tcp',

View File

@@ -24,10 +24,10 @@ export function createHttpRoute(
},
action: {
type: 'forward',
target: {
targets: [{
host: target.host,
port: target.port
}
}]
},
name: options.name || `HTTP: ${Array.isArray(domains) ? domains.join(', ') : domains}`
};
@@ -53,10 +53,10 @@ export function createHttpsTerminateRoute(
},
action: {
type: 'forward',
target: {
targets: [{
host: target.host,
port: target.port
},
}],
tls: {
mode: options.reencrypt ? 'terminate-and-reencrypt' : 'terminate',
certificate: options.certificate || 'auto'
@@ -83,10 +83,10 @@ export function createHttpsPassthroughRoute(
},
action: {
type: 'forward',
target: {
targets: [{
host: target.host,
port: target.port
},
}],
tls: {
mode: 'passthrough'
}