oxidecomputer / dropshot

expose REST APIs from a Rust program
Apache License 2.0
850 stars 74 forks source link

Allow configuring http server parameters. #726

Open luqmana opened 1 year ago

luqmana commented 1 year ago

While investigating https://github.com/oxidecomputer/omicron/issues/3559 I wanted to change some some parameters like the HTTP/2 connection/stream window sizes but dropshot doesn't expose any way of doing so. The only way seems to be just cloning the repo, making the change, and use [patch] in Cargo.toml to pick it up in the downstream crate.

There are number of such options hyper's Builder exposes.

rcgoodfellow commented 1 year ago

I've found myself in a similar situation. I need to set SO_REUSEADDR on the underlying TCP socket for a Dropshot server. It looks like being able to pass in a hyper Builder would allow that to happen.

davepacheco commented 1 year ago

Sounds good. There's no principled reason this isn't done. It just wasn't needed.

@jclulow and I discussed at some point creating a builder pattern that would allow people to provide ConfigDropshot, but wouldn't limit us to accepting things that way. It could also, for example, let you provide a hyper::Builder instead. This kind of thing could also allow us to avoid the breaking change from #676, though I wouldn't block a release on doing that work.