diff --git a/fly.toml b/fly.toml index ef26804..20e9227 100644 --- a/fly.toml +++ b/fly.toml @@ -4,36 +4,30 @@ kill_signal = "SIGINT" kill_timeout = "5s" [deploy] -strategy = "rolling" + strategy = "rolling" [env] -PORT = "8080" + PORT = "8080" [[services]] -protocol = "tcp" -internal_port = 8080 - -[[services.ports]] -port = 80 -handlers = ["http"] - -[[services.ports]] -port = 443 -handlers = ["tls", "http"] - -[[services.tcp_checks]] -interval = "10s" -timeout = "2s" -grace_period = "1s" -restart_limit = 0 - -[services.concurrency] -type = "connections" -hard_limit = 50 -soft_limit = 40 - -# Enable HTTP/2 support via h2c protocol: -# https://github.com/mccutchen/httpbingo.org/pull/6 -# https://community.fly.io/t/support-for-http-trailers/21915 -[services.ports.http_options] -h2_backend = true + protocol = "tcp" + internal_port = 8080 + + [[services.ports]] + port = 80 + handlers = ["http"] + + [[services.ports]] + port = 443 + handlers = ["tls", "http"] + + [services.concurrency] + type = "connections" + hard_limit = 50 + soft_limit = 40 + + [[services.tcp_checks]] + interval = "10s" + timeout = "2s" + grace_period = "1s" + restart_limit = 0 diff --git a/go.mod b/go.mod index 3017bc1..58124a5 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,6 @@ go 1.22.0 require ( github.com/mccutchen/go-httpbin/v2 v2.15.0 github.com/rs/zerolog v1.33.0 - golang.org/x/net v0.29.0 ) require ( @@ -13,5 +12,4 @@ require ( github.com/mattn/go-isatty v0.0.20 // indirect github.com/rs/xid v1.6.0 // indirect golang.org/x/sys v0.25.0 // indirect - golang.org/x/text v0.18.0 // indirect ) diff --git a/go.sum b/go.sum index 1e967fb..8ac24e4 100644 --- a/go.sum +++ b/go.sum @@ -14,12 +14,8 @@ github.com/rs/xid v1.6.0 h1:fV591PaemRlL6JfRxGDEPl69wICngIQ3shQtzfy2gxU= github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0= github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= -golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= -golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= -golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= diff --git a/main.go b/main.go index a93c628..869ec9c 100644 --- a/main.go +++ b/main.go @@ -13,8 +13,6 @@ import ( "github.com/mccutchen/go-httpbin/v2/httpbin" "github.com/rs/zerolog" "github.com/rs/zerolog/hlog" - "golang.org/x/net/http2" - "golang.org/x/net/http2/h2c" ) const ( @@ -57,13 +55,6 @@ func main() { handler = hlog.AccessHandler(requestLogger)(handler) handler = hlog.NewHandler(logger)(handler) - // fly.io downgrades HTTP/2 connections to HTTP/1.1 by default, but will - // use h2c if explicitly enabled. This should hopefully allow HTTP trailers - // to work w/ HTTP/2 requests. See discussion[1] for a bit more context. - // - // [1]: https://community.fly.io/t/support-for-http-trailers/21915 - handler = h2c.NewHandler(handler, &http2.Server{}) - srv := &http.Server{ Addr: fmt.Sprintf("0.0.0.0:%s", os.Getenv("PORT")), Handler: handler,