openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
3 lines • 805 B
JavaScript
import{l as normalizeOptionalString}from"./string-coerce-CpTFcSwY.mjs";
//!src/shared/gateway-bind-url.ts
function resolveGatewayBindUrl(e){const t=e.bind??`loopback`;if(t===`custom`){const t=normalizeOptionalString(e.customBindHost);if(t)return{url:`${e.scheme}://${t}:${e.port}`,source:`gateway.bind=custom`};return{error:`gateway.bind=custom requires gateway.customBindHost.`}}if(t===`tailnet`){const t=e.pickTailnetHost();if(t)return{url:`${e.scheme}://${t}:${e.port}`,source:`gateway.bind=tailnet`};return{error:`gateway.bind=tailnet set, but no tailnet IP was found.`}}if(t===`lan`){const t=e.pickLanHost();if(t)return{url:`${e.scheme}://${t}:${e.port}`,source:`gateway.bind=lan`};return{error:`gateway.bind=lan set, but no private LAN IP was found.`}}return null}export{resolveGatewayBindUrl as t};