Finally we got gRPC working in #dstack after spending a hole day! Since the dstack gateway can wrap arbitrary TCP in TLS, I assumed it would just work. It didn’t.
The key detail: gRPC runs on HTTP/2. HTTP/2 typically relies on ALPN (Application-Layer Protocol Negotiation) during the TLS handshake.
Think of ALPN as the moment both sides agree which protocol to speak (h2 for HTTP/2) before they exchange any actual data. If this step fails, the connection falls back to HTTP/1.1 — which gRPC can’t use.
For a gateway to handle gRPC correctly, it must: 1️⃣ Support HTTP/2 end-to-end 2️⃣ Negotiate h2 with ALPN during the TLS handshake 3️⃣ Preserve gRPC’s binary framing and trailers Miss any of these, and you’ll see strange hangs, missing errors, or broken streams.
687