[PR #1326] [CLOSED] [Other] serve: support IPv6 bind addresses #3385

Closed
opened 2026-11-07 14:41:07 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1326
Author: @purrsec
Created: 10/7/2026
Status: ❌ Closed

Base: main ← Head: fix/ipv6-listen


📝 Commits (3)

  • 87989e1 serve: support IPv6 bind addresses
  • 3464554 Merge remote-tracking branch 'origin/main' into fix/ipv6-listen
  • 45b3b18 Merge branch 'main' into fix/ipv6-listen

📊 Changes

6 files changed (+148 additions, -102 deletions)

View changed files

📝 README.fr.md (+30 -94)
📝 README.md (+33 -0)
📝 docs/DETAILS.md (+2 -0)
📝 serve/server.py (+45 -3)
📝 serve/test_security.py (+33 -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. The server now selects AF_INET6 for IPv6 literals, binds ::, serves requests through ::1, and formats IPv6 URLs with brackets. IPv4 behavior remains unchanged.

https://github.com/Niko1221/Strata/pull/1326#issuecomment-6156754724

Approach

Add an IPv6 Server subclass and select it for IPv6 literals in both the startup preflight and the running server. Advertise the loopback URL as [::1] for --host ::, and document the IPv6 option. No default or authentication behavior changes; an API key remains recommended when listening beyond loopback.

Validation

Passed:

  • python3 -m py_compile serve/server.py serve/test_security.py setup.py at fb2f6952 on macOS.
  • PYTHONPATH=<temporary requirements target> python3 -m unittest serve.test_security -v: 28 tests passed, including a real :: bind and /health request through ::1.
  • git diff --check origin/main...HEAD: passed.

Failed:

  • PYTHONPATH=<temporary requirements target> python3 -m unittest serve.test_server -q: 341 tests ran; one existing vision test failed because serve/lifeline.py expects a mocked process to expose .pid under Python 3.14. This is unrelated to the IPv6 changes.

Not run:

  • CUDA, HIP, SYCL and Metal builds; this change only touches the Python server, setup help, tests and documentation.

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.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/1326 **Author:** [@purrsec](https://github.com/purrsec) **Created:** 10/7/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/ipv6-listen` --- ### 📝 Commits (3) - [`87989e1`](https://github.com/Niko1221/Strata/commit/87989e1a2638efa5a833bc987497239f0f80f87a) serve: support IPv6 bind addresses - [`3464554`](https://github.com/Niko1221/Strata/commit/346455439ee4cb9e510c0eb7f9a2159a9cf49586) Merge remote-tracking branch 'origin/main' into fix/ipv6-listen - [`45b3b18`](https://github.com/Niko1221/Strata/commit/45b3b180986e6f65d84f34a99ff3cb408efb7a54) Merge branch 'main' into fix/ipv6-listen ### 📊 Changes **6 files changed** (+148 additions, -102 deletions) <details> <summary>View changed files</summary> 📝 `README.fr.md` (+30 -94) 📝 `README.md` (+33 -0) 📝 `docs/DETAILS.md` (+2 -0) 📝 `serve/server.py` (+45 -3) 📝 `serve/test_security.py` (+33 -1) 📝 `setup.py` (+5 -4) </details> ### 📄 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. The server now selects `AF_INET6` for IPv6 literals, binds `::`, serves requests through `::1`, and formats IPv6 URLs with brackets. IPv4 behavior remains unchanged. ## Related discussion https://github.com/Niko1221/Strata/pull/1326#issuecomment-6156754724 ## Approach Add an IPv6 `Server` subclass and select it for IPv6 literals in both the startup preflight and the running server. Advertise the loopback URL as `[::1]` for `--host ::`, and document the IPv6 option. No default or authentication behavior changes; an API key remains recommended when listening beyond loopback. ## Validation **Passed:** - `python3 -m py_compile serve/server.py serve/test_security.py setup.py` at `fb2f6952` on macOS. - `PYTHONPATH=<temporary requirements target> python3 -m unittest serve.test_security -v`: 28 tests passed, including a real `::` bind and `/health` request through `::1`. - `git diff --check origin/main...HEAD`: passed. **Failed:** - `PYTHONPATH=<temporary requirements target> python3 -m unittest serve.test_server -q`: 341 tests ran; one existing vision test failed because `serve/lifeline.py` expects a mocked process to expose `.pid` under Python 3.14. This is unrelated to the IPv6 changes. **Not run:** - CUDA, HIP, SYCL and Metal builds; this change only touches the Python server, setup help, tests and documentation. ## Limits IPv6 support depends on the host OS having IPv6 enabled. Listening beyond loopback still requires an API key in normal startup. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 14:41:07 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3385
No description provided.