@stacksjs/rpx
Version:
A modern and smart reverse proxy.
30 lines (29 loc) • 1.47 kB
TypeScript
import type { ProductionTlsConfig } from './types';
/**
* Production gateways keep many TLS contexts alive and may serve large,
* concurrent responses. Ask OpenSSL to release per-connection read and write
* buffers as soon as they are idle instead of retaining their peak size for the
* lifetime of every keep-alive socket.
*/
export declare function withLowMemoryTls(tls: Bun.TLSOptions): Bun.TLSOptions;
export declare function withLowMemoryTls(tls: Bun.TLSOptions[]): Bun.TLSOptions[];
export declare function withLowMemoryTls(tls: Bun.TLSOptions | Bun.TLSOptions[]): Bun.TLSOptions | Bun.TLSOptions[];
/**
* Map a PEM filename under a `certsDir` to its SNI server name. Returns `null`
* for files that aren't `<name>.crt`. The wildcard convention
* `_wildcard.<apex>.crt` maps to server name `*.<apex>`.
*/
export declare function serverNameFromCertFilename(filename: string): string | null;
/**
* Build the SNI TLS array from a {@link ProductionTlsConfig}. Reads PEM files
* from an explicit `domains` map and/or a `certsDir` convention. Files that
* can't be read are skipped (logged in verbose mode). Returns `[]` when nothing
* usable is found so the caller can fall back to the dev cert flow.
*/
export declare function buildSniTlsConfig(cfg: ProductionTlsConfig, verbose?: boolean): Promise<SniTlsEntry[]>;
/** One entry of the Bun.serve `tls` array. */
export declare interface SniTlsEntry {
serverName: string
cert: string
key: string
}