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

@@ -1,5 +1,13 @@
# Changelog
## 2026-02-26 - 4.3.0 - feat(hub)
add optional TLS certificate/key support to hub start config and bridge
- TypeScript: add tls.certPem and tls.keyPem to IHubConfig and include tlsCertPem/tlsKeyPem in startHub bridge command when both are provided
- TypeScript: extend startHub params with tlsCertPem and tlsKeyPem and conditionally send them
- Rust: change HubConfig serde attributes for tls_cert_pem and tls_key_pem from skip to default so absent PEM fields deserialize as None
- Enables optional provisioning of TLS certificate and key to the hub when provided from the JS side
## 2026-02-26 - 4.2.0 - feat(core)
expose edge peer address in hub events and migrate writers to channel-based, non-blocking framing with stream limits and timeouts

View File

@@ -15,9 +15,9 @@ use remoteingress_protocol::*;
pub struct HubConfig {
pub tunnel_port: u16,
pub target_host: Option<String>,
#[serde(skip)]
#[serde(default)]
pub tls_cert_pem: Option<String>,
#[serde(skip)]
#[serde(default)]
pub tls_key_pem: Option<String>,
}

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@serve.zone/remoteingress',
version: '4.2.0',
version: '4.3.0',
description: 'Edge ingress tunnel for DcRouter - accepts incoming TCP connections at network edge and tunnels them to DcRouter SmartProxy preserving client IP via PROXY protocol v1.'
}

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;