Support exposed port resolution in Cloudflare sandbox#3525
Draft
ghostwriternr wants to merge 1 commit into
Draft
Support exposed port resolution in Cloudflare sandbox#3525ghostwriternr wants to merge 1 commit into
ghostwriternr wants to merge 1 commit into
Conversation
Resolve Cloudflare sandbox ports through the worker exposed-port endpoint and parse the returned URL into the SDK endpoint shape. Keep existing exposed_ports behavior intact while allowing callers to map sandbox ports to named Cloudflare endpoint prefixes through exposed_port_names. Ports with names are also tracked as exposed ports so existing resolution guards continue to apply, and provider or malformed responses surface as exposed-port errors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds exposed port resolution for the Cloudflare sandbox extension, allowing callers to obtain external HTTP endpoints for services running inside a sandbox.
The new
exposed_port_namesoption maps sandbox ports to named endpoint prefixes. Ports listed only inexposed_port_namesare treated as exposed ports automatically, so existingresolve_exposed_portvalidation still applies. When resolving a port, unnamed ports request ephemeral endpoints from the Cloudflare Sandbox Bridge, while named ports pass the configured prefix.This requires a compatible Cloudflare Sandbox Bridge deployment that implements
POST /v1/sandbox/:id/exposed-port/:port. The SDK resolves endpoint metadata through the bridge, but it does not start the application listening inside the sandbox; user code is still responsible for binding to the target port.