mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
docs: for localhost access
This commit is contained in:
@@ -37,6 +37,8 @@ For local network access:
|
|||||||
http://<your-computer-ip>:3006
|
http://<your-computer-ip>: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:
|
For internet access:
|
||||||
- If the hub has a public IP, access it directly (use HTTPS via reverse proxy for production)
|
- 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)
|
- 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
|
- Check firewall allows port 3006
|
||||||
- Verify `HAPI_API_URL` is correct
|
- 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://<your-computer-ip>:3006
|
||||||
|
```
|
||||||
|
|
||||||
|
Also verify your OS firewall allows inbound connections on port `3006`.
|
||||||
|
|
||||||
### "Invalid token" error
|
### "Invalid token" error
|
||||||
|
|
||||||
- Re-run `hapi auth login`
|
- Re-run `hapi auth login`
|
||||||
|
|||||||
Reference in New Issue
Block a user