Skip to content

fix(server): use internal endpoint resolution for proxy route#404

Merged
Pangjiping merged 1 commit intoalibaba:mainfrom
suger-m:fix/proxy-resolve-internal-402-v2
Mar 10, 2026
Merged

fix(server): use internal endpoint resolution for proxy route#404
Pangjiping merged 1 commit intoalibaba:mainfrom
suger-m:fix/proxy-resolve-internal-402-v2

Conversation

@suger-m
Copy link
Contributor

@suger-m suger-m commented Mar 10, 2026

Fixes #402

Summary

This PR fixes proxy endpoint resolution in proxy_sandbox_endpoint_request.

Previously, the proxy route called get_endpoint(sandbox_id, port), which may return a non-internal/proxied endpoint depending on runtime configuration. That behavior is incorrect for server-side request forwarding.

This change updates the proxy route to explicitly call get_endpoint(sandbox_id, port, resolve_internal=True), ensuring requests are always forwarded to the sandbox internal endpoint.

Tests are updated accordingly:

  • proxy route stubs now accept the resolve_internal argument
  • an assertion is added to verify resolve_internal=True is passed in the proxy path

Testing

  • Not run (explain why)
  • Unit tests
  • Integration tests
  • e2e / manual verification

Executed:

  • uv run pytest tests/test_routes_proxy.py
  • uv run pytest tests/test_routes_endpoint_behavior.py

Breaking Changes

  • None
  • Yes (describe impact and migration path)

Checklist

  • Linked Issue or clearly described motivation
  • Added/updated docs (if needed)
  • Added/updated tests (if needed)
  • Security impact considered
  • Backward compatibility considered

@Pangjiping Pangjiping self-assigned this Mar 10, 2026
@Pangjiping Pangjiping added bug Something isn't working component/server labels Mar 10, 2026
Copy link
Collaborator

@Pangjiping Pangjiping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Pangjiping Pangjiping merged commit ec7e7c2 into alibaba:main Mar 10, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working component/server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Server proxy handler fails on Linux with firewall (ufw) — should use resolve_internal=True

2 participants