Skip to content

docs: explain HTTP proxy address when AstrBot runs in Docker - #10162

Merged
Soulter merged 2 commits into
AstrBotDevs:masterfrom
w1ndys:docs/docker-http-proxy
Sep 21, 2026
Merged

Soulter merged 2 commits into
AstrBotDevs:masterfrom
w1ndys:docs/docker-http-proxy

Conversation

@w1ndys

@w1ndys w1ndys commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Summary

The HTTP proxy field currently documents http://localhost:7890. That address is correct for a host process, but AstrBot applies http_proxy inside its own process. When AstrBot runs in Docker, 127.0.0.1 / localhost points at the AstrBot container, not a proxy on the host or in another container.

This PR documents the addresses that are reachable from the AstrBot container:

  • Docker Desktop (Mac / Windows): http://host.docker.internal:7890
  • Linux: http://172.17.0.1:7890 (or the docker0 gateway)
  • Same Docker network: the proxy container name, e.g. http://clash:7890

It also notes that publishing 127.0.0.1:7890:7890 keeps the proxy unreachable from other containers.

Docs

  • docs/zh/deploy/astrbot/docker.md and docs/en/deploy/astrbot/docker.md: new section after the existing Docker network tip
  • docs/zh/dev/astrbot-config.md and docs/en/dev/astrbot-config.md: http_proxy points to the Docker guide
  • docs/zh/use/webui.md and docs/en/use/webui.md: Network settings link to the Docker guide

WebUI path checked against current copy: Settings → Network → Proxy & Dependency Sources → HTTP Proxy.

Verification

  • Ran cd docs && npm run docs:build (VitePress 1.6.4). Build completed in 27.07s with no errors.
  • Checked the Docker deploy, http_proxy config, and WebUI system settings pages in zh and en.

Summary by Sourcery

Clarify Docker-compatible HTTP proxy configuration across the AstrBot documentation.

Enhancements:

  • Document how to configure HTTP proxies for AstrBot when running in Docker, including host, Linux gateway, and same-network container addresses.
  • Link the HTTP proxy configuration and WebUI network settings to the Docker deployment guidance in English and Chinese documentation.

Documentation:

  • Add bilingual Docker proxy guidance covering container reachability, protocols, host binding, and port publishing.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="docs/en/deploy/astrbot/docker.md" line_range="139" />
<code_context>
+
+Set the HTTP proxy in the WebUI under `Settings → Network → Proxy & Dependency Sources → HTTP Proxy`. AstrBot reaches that address **from inside its own container**, so `http://127.0.0.1:7890` points at the AstrBot container itself rather than the host or another container.
+
+If the proxy runs on the host, or in another container with the port published to the host:
+
+- Mac / Windows (Docker Desktop): `http://host.docker.internal:7890`
+- Linux: `http://172.17.0.1:7890` (replace `172.17.0.1` with your docker0 gateway if it differs)
+
+If AstrBot and the proxy share a Docker network, use the proxy container name, for example `http://clash:7890`.
+
+Clash-style clients commonly use HTTP on `7890` and SOCKS on `7891`. Use `http://` or `socks5://` to match the protocol. Publish the proxy port to the host, and avoid binding it only to `127.0.0.1` (`127.0.0.1:7890:7890` is unreachable from other containers via the gateway).
</code_context>
<issue_to_address>
**issue:** When the proxy runs directly on the host but listens only on `127.0.0.1`, the documented host-gateway addresses cannot reach it from the AstrBot container, so proxy requests fail with a connection error.

**Triggers:** When a host-installed Clash-style proxy uses its common localhost-only binding.

**Suggested fix:** State that a host-installed proxy must listen on a host interface reachable from Docker, such as `0.0.0.0` or the Docker gateway interface, rather than only `127.0.0.1`.

```suggestion
Clash-style clients commonly use HTTP on `7890` and SOCKS on `7891`. Use `http://` or `socks5://` to match the protocol. For a host-installed proxy, it must listen on a host interface reachable from Docker, such as `0.0.0.0` or the Docker gateway interface, rather than only `127.0.0.1`; publish the proxy port to the host.
```
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: docs/en/deploy/astrbot/docker.md:139


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread docs/en/deploy/astrbot/docker.md Outdated
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sourcery assessment

Approved.

@Soulter
Soulter merged commit 96d9504 into AstrBotDevs:master Sep 21, 2026
23 checks passed
@w1ndys
w1ndys deleted the docs/docker-http-proxy branch September 21, 2026 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants