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
Unknown Object (File)
Fri, Apr 5, 1:37 PM
Unknown Object (File)
Wed, Apr 3, 11:55 PM
Unknown Object (File)
Thu, Mar 28, 4:58 AM
Unknown Object (File)
Thu, Mar 28, 4:58 AM
Unknown Object (File)
Thu, Mar 28, 4:58 AM
Unknown Object (File)
Thu, Mar 28, 4:58 AM
Unknown Object (File)
Thu, Mar 28, 4:57 AM
Unknown Object (File)
Thu, Mar 28, 4:51 AM
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
Lint Not Applicable
Unit
Tests Not Applicable

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.