feat(proxy): forward native gRPC over h2c to sandbox backends - #3631
Open
Deep-Axe wants to merge 1 commit into
Open
feat(proxy): forward native gRPC over h2c to sandbox backends#3631Deep-Axe wants to merge 1 commit into
Deep-Axe wants to merge 1 commit into
Conversation
Keep HTTP/1.1 for browsers and user HTTP/WebSocket servers. Only speak HTTP/2 to the guest when Content-Type is native gRPC, so public :443 gRPC can work without enabling HTTP/2 for every sandbox port.
Deep-Axe
requested review from
ValentaTomas,
dobrac and
jakubno
as code owners
September 10, 2026 08:42
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.
Summary
python -m http.server, and VNC/wskeep working.application/grpc/application/grpc+…, notapplication/grpc-web) and send those requests over h2c. ShareddialUpstreamretries still cover envd/socat startup.Content-Lengthso HTTP/1.1 hops in front of the proxy can still surfacegrpc-status.main. This PR only changes the Go proxy. If the new LB ever protocol-selects on Content-Type, it must not prefix-matchapplication/grpc(that would include grpc-web).Suggested matcher is documented in tests:
(?)^application/grpc($|[+;].*).Closes e2b-dev/desktop#114
Test plan
go test ./packages/shared/pkg/proxy/pool ./packages/shared/pkg/proxygrpc.secure_channel(sandbox.get_grpc_target(50051), grpc.ssl_channel_credentials())against a guest gRPC server succeeds after this is deployed