From bfc9ad9f0ce66fd15acc3482ea6b4f0caa986473 Mon Sep 17 00:00:00 2001 From: weishu Date: Mon, 16 Mar 2026 08:54:04 +0800 Subject: [PATCH] docs: for localhost access --- docs/guide/faq.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/docs/guide/faq.md b/docs/guide/faq.md index 9eb8af2d..1215a9ec 100644 --- a/docs/guide/faq.md +++ b/docs/guide/faq.md @@ -37,6 +37,8 @@ For local network access: http://:3006 ``` +If your phone cannot connect, make sure the hub is not only listening on `127.0.0.1`. For LAN access, set `listenHost` to `0.0.0.0` in `~/.hapi/settings.json` or set `HAPI_LISTEN_HOST=0.0.0.0`, then restart `hapi hub`. + For internet access: - If the hub has a public IP, access it directly (use HTTPS via reverse proxy for production) - If behind NAT, set up a tunnel (Cloudflare Tunnel, Tailscale, or ngrok) @@ -129,6 +131,30 @@ Only if they have your access token. For additional security: - Check firewall allows port 3006 - Verify `HAPI_API_URL` is correct +### My phone cannot access HAPI on the local network + +If HAPI works on your computer but not from another device on the same LAN, check the hub bind address first. By default, HAPI listens on `127.0.0.1`, which only accepts localhost connections. + +Use one of these: + +```json +{ + "listenHost": "0.0.0.0" +} +``` + +```bash +export HAPI_LISTEN_HOST=0.0.0.0 +``` + +Then restart `hapi hub` and open: + +```bash +http://:3006 +``` + +Also verify your OS firewall allows inbound connections on port `3006`. + ### "Invalid token" error - Re-run `hapi auth login`