feat(hub): add optional TLS certificate/key support to hub start config and bridge

This commit is contained in:
2026-02-26 23:47:16 +00:00
parent 417f62e646
commit 56a14aa7c5
4 changed files with 20 additions and 3 deletions

View File

@@ -11,6 +11,8 @@ type THubCommands = {
params: {
tunnelPort: number;
targetHost?: string;
tlsCertPem?: string;
tlsKeyPem?: string;
};
result: { started: boolean };
};
@@ -42,6 +44,10 @@ type THubCommands = {
export interface IHubConfig {
tunnelPort?: number;
targetHost?: string;
tls?: {
certPem?: string;
keyPem?: string;
};
}
export class RemoteIngressHub extends EventEmitter {
@@ -100,6 +106,9 @@ export class RemoteIngressHub extends EventEmitter {
await this.bridge.sendCommand('startHub', {
tunnelPort: config.tunnelPort ?? 8443,
targetHost: config.targetHost ?? '127.0.0.1',
...(config.tls?.certPem && config.tls?.keyPem
? { tlsCertPem: config.tls.certPem, tlsKeyPem: config.tls.keyPem }
: {}),
});
this.started = true;