Skip to content

feat(webui,auth): default same-origin proxy; session auth behind proxies#194

Merged
duguwanglong merged 1 commit into
mainfrom
feat/webui-proxy-defaults-and-auth-session
Apr 28, 2026
Merged

feat(webui,auth): default same-origin proxy; session auth behind proxies#194
duguwanglong merged 1 commit into
mainfrom
feat/webui-proxy-defaults-and-auth-session

Conversation

@xiami762

Copy link
Copy Markdown
Contributor

Summary

  • WebUI / CLI: Non-loopback backends now default to same-origin /api proxy mode (no VITE_API_BASE_URL / VITE_WS_BASE_URL unless FLOCKS_WEBUI_DIRECT_BACKEND_URLS=1 is set). Documented in README.
  • Auth: Session cookie is resolved early in apply_auth_for_request; browser-like detection extended for SSE / reverse-proxy (existing session cookie, Mozilla + HTML/SSE Accept).
  • WebUI dev proxy: xfwd: true on /api and /event so X-Forwarded-* reaches the backend.

Tests

  • uv run pytest tests/server/test_auth_compat.py tests/cli/test_service_manager.py
  • npm test -- --run src/config/apiProxy.test.ts (webui)

Made with Cursor

- Default WebUI to same-origin /api proxy for non-loopback backends; opt-in
  direct VITE_* URLs via FLOCKS_WEBUI_DIRECT_BACKEND_URLS.
- Resolve session from cookie early in apply_auth_for_request; broaden
  browser-like detection for SSE/reverse-proxy (session cookie, Mozilla UA).
- Enable xfwd on Vite dev proxies so X-Forwarded-* reach the backend.
- Document LAN/reverse-proxy behavior in README; extend CLI and auth tests.

Made-with: Cursor
@duguwanglong duguwanglong merged commit 7e9c621 into main Apr 28, 2026
2 checks passed
duguwanglong pushed a commit to DearEmma/flocks that referenced this pull request May 18, 2026
…ies (AgentFlocks#194)

- Default WebUI to same-origin /api proxy for non-loopback backends; opt-in
  direct VITE_* URLs via FLOCKS_WEBUI_DIRECT_BACKEND_URLS.
- Resolve session from cookie early in apply_auth_for_request; broaden
  browser-like detection for SSE/reverse-proxy (session cookie, Mozilla UA).
- Enable xfwd on Vite dev proxies so X-Forwarded-* reach the backend.
- Document LAN/reverse-proxy behavior in README; extend CLI and auth tests.
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