Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable h2c for HTTP/2 support on fly.io #6

Merged
merged 3 commits into from
Sep 19, 2024
Merged

feat: enable h2c for HTTP/2 support on fly.io #6

merged 3 commits into from
Sep 19, 2024

Conversation

mccutchen
Copy link
Owner

In mccutchen/go-httpbin#184 and mccutchen/go-httpbin#186, go-httpbin added HTTP trailers to some endpoints. Our current host, fly.io, does not support trailers for HTTP/1.1 requests, but does support them for HTTP/2 requests. Properly handling HTTP/2 requests requires opting in to using the h2c protocol (basically, HTTP/2 in cleartext, masquerading as HTTP/1.1).

See discussion here for more context: https://community.fly.io/t/support-for-http-trailers/21915

With these changes deployed, we can now see trailers for HTTP/2 requests:

$ curl -s -v --raw --no-buffer --http2 'https://httpbingo.org/trailers?Trailer-1=Value-1&Trailer-2=Value-2'
> GET /trailers?Trailer-1=Value-1&Trailer-2=Value-2 HTTP/2
> Host: httpbingo.org
> User-Agent: curl/8.7.1
> Accept: */*
> 
* Request completely sent off
< HTTP/2 200 
< access-control-allow-credentials: true
< access-control-allow-origin: *
< content-type: application/json; charset=utf-8
< date: Thu, 19 Sep 2024 15:08:24 GMT
< server: Fly/bd16e0095 (2024-09-18)
< via: 2 fly.io
< fly-request-id: 01J85D7J4MC9S4V7BZ4CXJ9QFV-bos
< 
{
  [... json body elided ...]
}
< trailer-1: Value-1
< trailer-2: Value-2
* Connection #0 to host httpbingo.org left intact

@mccutchen mccutchen merged commit 121e91f into main Sep 19, 2024
2 checks passed
@mccutchen mccutchen deleted the h2c branch September 19, 2024 15:15
mccutchen added a commit that referenced this pull request Sep 19, 2024
mccutchen added a commit that referenced this pull request Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant