Skip to content

Commit 35d63ab

Browse files
alnrclaude
andcommitted
fix: raise the proxy and tunnel write timeout to 120s
graceful.WithDefaults applies a 10s write timeout, which cut any slower response off mid-flight and left the client with an empty reply rather than an error. The upstream is the developer's own application and may legitimately take longer. Closes #302 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JYzGVwAKQ4ormxRHZg1eDu
1 parent 107a5e9 commit 35d63ab

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

cmd/cloudx/proxy/helpers.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,11 @@ func runReverseProxy(ctx context.Context, h *client.CommandHelper, stdErr io.Wri
239239
server := graceful.WithDefaults(&http.Server{
240240
Addr: addr,
241241
Handler: ch.Handler(mw),
242+
// graceful.WithDefaults would otherwise apply a 10s write timeout, which
243+
// cuts any slower response off mid-flight and leaves the client with an
244+
// empty reply. The upstream here is the developer's own application and
245+
// may legitimately take longer than that.
246+
WriteTimeout: 120 * time.Second,
242247
})
243248

244249
if conf.isTunnel {

0 commit comments

Comments
 (0)