feat(hub): add optional TLS certificate/key support to hub start config and bridge
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user