Fixes for http

This commit is contained in:
Raven Scott
2026-04-22 03:55:14 -04:00
parent 7b8fb056c0
commit 4b87f2e2d8
4 changed files with 113 additions and 13 deletions
@@ -48,8 +48,10 @@ export async function ensureBareOsWwwHolesailTunnel(ctx, env, port) {
if (!ctx.b4a || typeof ctx.b4a.from !== 'function') return
const { path, state } = await bareHolesailManagedReadState(ctx, env)
/** Holesail server mode requires an explicit loopback host. */
const wantHost = '127.0.0.1'
/** @type {Record<string, unknown>} */
const want = { server: true, port: p, enabled: true }
const want = { server: true, port: p, host: wantHost, enabled: true }
const existing = state.connections[id]
if (existing && typeof existing === 'object') {
const ex = /** @type {Record<string, unknown>} */ (existing)
@@ -59,7 +61,9 @@ export async function ensureBareOsWwwHolesailTunnel(ctx, env, port) {
ex.enabled === undefined || ex.enabled === null || String(ex.enabled) === ''
? true
: bareHolesailEnvTruthy(ex.enabled)
if (server && curPort === p && enabled) {
const rawHost = String(ex.host ?? '').trim()
const hostOk = rawHost === wantHost
if (server && curPort === p && enabled && hostOk) {
if (bareHolesailManagedServiceIsRunning()) {
try {
await bareHolesailManagedStartOne(ctx, env, id)