fix(gateway): improve error message for Docker bridge connectivity (#4095)

When the gateway security guard blocks a public bind address, the error
message now mentions the Docker use case and provides clear instructions
for connecting from Docker containers.

Closes #4086
This commit is contained in:
Argenis 2026-03-21 00:16:01 -04:00 committed by Roman Tataurov
parent 28c540cbad
commit 26da2ebe73
No known key found for this signature in database
GPG Key ID: 70A51EF3185C334B

View File

@ -365,7 +365,10 @@ pub async fn run_gateway(host: &str, port: u16, config: Config) -> Result<()> {
anyhow::bail!(
"🛑 Refusing to bind to {host} — gateway would be exposed to the internet.\n\
Fix: use --host 127.0.0.1 (default), configure a tunnel, or set\n\
[gateway] allow_public_bind = true in config.toml (NOT recommended)."
[gateway] allow_public_bind = true in config.toml (NOT recommended).\n\n\
Docker: if you need to reach the gateway from a Docker container, set\n\
[gateway] host = \"0.0.0.0\" and allow_public_bind = true in config.toml,\n\
then connect from the container via ws://host.docker.internal:{port}."
);
}
let config_state = Arc::new(Mutex::new(config.clone()));