[Bug] Proxy + IPv6 [::] binding prevents GUI dynamic fields from appearing
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start in the legacy 1.x GUI launch path and locate the bind_addresses definition shown in the report. Reproduce the startup-events failure with HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, and NO_PROXY enabled, then verify the GUI uses the proxy-safe IPv4 loopback first and that service-dependent fields appear. Confirm the existing interactive translation flow still works.
Written by the indexing model from the issue text.
Description
Scope note: this report is specifically about the legacy 1.x GUI implementation in
PDFMathTranslate/PDFMathTranslate. I did not reproduce it against PDFMathTranslate-next because its GUI/configuration implementation has been rewritten. I am reporting it here so other 1.x users behind a proxy can find the cause and workaround.
Environment
- OS: Windows 11
- Python: 3.12.14
- pdf2zh: 1.9.12
- Gradio: 5.35.0
- Commit:
f4522dd - Installation: source
HTTP_PROXY,HTTPS_PROXY, andALL_PROXYare enabledNO_PROXY=localhost,127.0.0.1,::1
Description
The Web UI opens, but dynamic GUI callbacks do not work. For example, selecting DeepSeek in the Service dropdown does not reveal the DEEPSEEK_API_KEY and DEEPSEEK_MODEL fields.
The legacy GUI tries to bind to [::] before IPv4 addresses. Gradio then checks:
http://[::]:7860/gradio_api/startup-events
With the proxy environment described above, that request is routed through the proxy and returns HTTP 502. A browser page may still be served, but Gradio startup events do not complete, leaving dropdown-dependent components stuck or invisible.
This is consistent with the failure mode described in gradio-app/gradio#10729.
Steps to reproduce
-
On Windows, enable an HTTP proxy through
HTTP_PROXY,HTTPS_PROXY, and/orALL_PROXY. -
Keep the common local bypass value
NO_PROXY=localhost,127.0.0.1,::1. -
Start the GUI:
pdf2zh --interactive --serverport 7860 -
Open the generated Web UI.
-
Select DeepSeek from Service.
-
Observe that the API key/model fields do not appear and the event remains pending.
A minimal Gradio launch using server_name="[::]" reproduces the startup check failure with:
Couldn't start the app because 'http://[::]:7860/gradio_api/startup-events' failed (code 502)
Expected behavior
The local GUI should bind to a proxy-safe loopback address, and selecting a service should immediately update its configuration fields.
Root cause
The current 1.x binding order prefers the IPv6 wildcard:
bind_addresses = []
if _has_ipv6():
bind_addresses.append("[::]")
bind_addresses.append("0.0.0.0")
bind_addresses.append("127.0.0.1")
Many proxy configurations bypass 127.0.0.1 but do not correctly bypass wildcard/bracketed IPv6 URLs.
Confirmed local fix
Prefer IPv4 loopback for the local interactive GUI:
bind_addresses = ["127.0.0.1", "0.0.0.0"]
if _has_ipv6():
bind_addresses.append("[::]")
After this change the GUI launches at http://127.0.0.1:7860, the DeepSeek fields appear, and a 14-page translation completes successfully through the configured DeepSeek service.
References
- Project FAQ already notes that global proxy mode can prevent Gradio from starting: https://github.com/PDFMathTranslate/PDFMathTranslate/wiki/FAQ---%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98
- Related Gradio startup-events behavior: https://github.com/gradio-app/gradio/issues/10729
- Dominant language
- Python
- Stars
- 37.1k
- Forks
- 3.3k
- Avg merge
- 11m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PDFMathTranslate/PDFMathTranslate
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
PDFMathTranslate/PDFMathTranslate#1194 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
PDFMathTranslate/PDFMathTranslate#1167 · 1 comment · 2 reactions ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
PDFMathTranslate/PDFMathTranslate#1108 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
PDFMathTranslate/PDFMathTranslate#1188 ·
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 38/100
PDFMathTranslate/PDFMathTranslate#1186 · 2 comments ·
All issues in PDFMathTranslate/PDFMathTranslate
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100