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)
Sun, Nov 10, 7:21 PM
Unknown Object (File)
Fri, Nov 8, 12:44 PM
Unknown Object (File)
Fri, Nov 8, 4:13 AM
Unknown Object (File)
Thu, Nov 7, 11:57 PM
Unknown Object (File)
Thu, Oct 31, 6:36 AM
Unknown Object (File)
Wed, Oct 30, 4:57 AM
Unknown Object (File)
Wed, Oct 30, 4:57 AM
Unknown Object (File)
Wed, Oct 30, 4:57 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.