mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3212] [CLOSED] [Other] serve: support IPv6 bind addresses #4501
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4501
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/3212
Author: @purrsec
Created: 10/19/2026
Status: ❌ Closed
Base:
main← Head:fix/ipv6-listen📝 Commits (1)
7aea86cserve: support IPv6 bind addresses📊 Changes
6 files changed (+59 additions, -10 deletions)
View changed files
📝
README.fr.md(+2 -0)📝
README.md(+2 -0)📝
docs/DETAILS.md(+2 -0)📝
serve/server.py(+11 -5)📝
serve/test_security.py(+37 -1)📝
setup.py(+5 -4)📄 Description
Problem and result
Starting Strata with an IPv6 bind address such as
--host ::failed before model loading because the HTTP server always used an IPv4 socket.Servernow selectsAF_INET6when the bind address is an IPv6 literal, binds::, serves requests through::1, and formats IPv6 URLs with brackets. IPv4 behavior remains unchanged.Related discussion
Supersedes closed PR #1326: https://github.com/Niko1221/Strata/pull/1326
Approach
Set
self.address_family = socket.AF_INET6directly inServer.__init__when the bind address contains:, so both the startup preflight check and the running server use the right socket family without extra wrapper classes. Advertise the loopback URL as[::1]for--host ::, bracket IPv6 literals in printed URLs, and document the IPv6 option. No default or authentication behavior changes; an API key remains required when listening beyond loopback.Validation
Passed:
python3 -m py_compile serve/server.py serve/test_security.py setup.pyat7aea86c1on macOS.python3 -m unittest serve.test_security -v: 28 tests passed, includingServeraddress family selection and a real::bind and/healthrequest through::1.git diff --check origin/main...HEAD: passed.Not run:
Limits
IPv6 support depends on the host OS having IPv6 enabled. Listening beyond loopback still requires an API key in normal startup.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.