Page MenuHomePhabricator

[services][feature-flags] Add hello world http server
ClosedPublic

Authored by tomek on Feb 23 2023, 8:38 AM.
Tags
None
Referenced Files
F1432519: D6860.id23234.diff
Thu, Mar 28, 4:58 AM
F1432518: D6860.id23170.diff
Thu, Mar 28, 4:58 AM
F1432517: D6860.id23014.diff
Thu, Mar 28, 4:58 AM
F1432516: D6860.id23152.diff
Thu, Mar 28, 4:58 AM
F1432482: D6860.id.diff
Thu, Mar 28, 4:57 AM
F1432458: D6860.diff
Thu, Mar 28, 4:51 AM
Unknown Object (File)
Wed, Feb 28, 9:23 AM
Unknown Object (File)
Feb 21 2024, 2:05 PM
Subscribers

Details

Summary

Just a hello world http server. There are a couple of interesting servers available in Rust, but I've chosen this because it is relatively high level, performant, and easily integrates with https.

Depends on D6859

Test Plan

Send GET to / and check if response is returned. Checked if both 127.0.0.1 and [::1] work.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

tomek requested review of this revision.Feb 23 2023, 8:54 AM
bartek added inline comments.
services/feature-flags/src/service.rs
19 ↗(On Diff #23014)
This revision is now accepted and ready to land.Feb 24 2023, 4:22 AM
services/feature-flags/src/service.rs
19 ↗(On Diff #23014)

Good question! According to the docs you mentioned

When addr includes a hostname, it is possible for this method to bind to both the IPv4 and IPv6 addresses that result from a DNS lookup.

So using localhost will bind to both addresses.
On the other hand

Note that, if a DNS lookup is required, resolving hostnames is a blocking operation.

Which should be quick for localhost, but maybe it is better to use v4 and v6 addresses explicitly.