Typst cannot download package through proxy with IPv6 address
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 56.1k
- Forks
- 1.7k
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 22
Description
Description
With HTTPS_PROXY=http://[::1]:1081, typst compile file.typ will fail with error when a package needs to be downloaded:
error: failed to download package (https://packages.typst.org/preview/algo-0.3.6.tar.gz: Dns Failed: resolve dns name '[:80': failed to lookup address information: Name or service not known)
┌─ file.typ:2:8
│
2 │ #import "@preview/algo:0.3.6": algo, i, d, comment, code
│ ^^^^^^^^^^^^^^^^^^^^^
It seems typst thought [ is the hostname as there is a : following it and defaults to port 80, rather than the start of an IPv6 address.
And switching to HTTPS_PROXY=http://127.0.0.1:1081 will make it work as expected, downloading the package.
I'm on typst version 0.13.1, and NixOS unstable.
Reproduction URL
No response
Operating system
Linux
Typst version
- I am using the latest version of Typst
Contributor guide
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.
Research direction
Start by reproducing the failure with HTTPS_PROXY=http://[::1]:1081 and the shown typst compile command. Trace how the proxy URL is parsed before the package download, then verify that bracketed IPv6 hosts work without breaking the 127.0.0.1 case. Done means the package downloads successfully through the IPv6 proxy and regression coverage exists.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100