import type { Context, Hono } from 'hono'; import type { GatewayService } from '../gateway/service.js'; import type { IncomingMessage } from 'node:http'; import type { Socket } from 'node:net'; /** * Extract the share label from the request Host header when the public host * suffix matches. Returns `null` if the request did not target a site-share * subdomain. */ export declare function extractSiteShareLabel(host: string | null | undefined, suffix: string): string | null; /** * Hono middleware. Intercepts requests whose Host header is `*.share.xopc.ai` * (or matches the configured suffix), routes them to the matching site share. * Falls through to next() when the host does not match. * * Also handles the subpath fallback `/site/:token/*` for environments without * wildcard DNS — same handler logic, just different prefix extraction. */ export declare function createSiteShareMiddleware(service: GatewayService): (c: Context, next: () => Promise) => Promise; /** Standalone HTTP upgrade handler that bridges WebSocket requests to the proxy share. */ export declare function handleSiteShareUpgrade(service: GatewayService, req: IncomingMessage, socket: Socket, head: Buffer): boolean; /** Register the middleware on a Hono app — call from createHonoApp. */ export declare function registerSiteShareMiddleware(app: Hono, service: GatewayService): void;