sony / nmos-cpp

An NMOS (Networked Media Open Specifications) Registry and Node in C++ (IS-04, IS-05)
Apache License 2.0
136 stars 80 forks source link

Discovery mode revisited #374

Closed garethsb closed 4 months ago

garethsb commented 4 months ago

POC of replacing discovery_mode setting with sneakily stashing Host header in the web::uri values returned by nmos::details::resolve_service and using this in a web::http::http_pipeline_stage.

Resolves #357

Using the user info in this way is a bit icky. But the other option is to make lots of places that pass web::uri around pass a pair of the URI with the Host header. This way has the side effect of making the values in the settings look something like this whether doing HTTP or HTTPS:

"registration_services": [
  "http://reg0.example.com@192.0.2.0:80/x-nmos/registration/v1.3",
  "http://reg0.example.com@198.51.100.0:80/x-nmos/registration/v1.3",
  "http://reg0.example.com@203.0.113.0:80/x-nmos/registration/v1.3",
  "http://reg1.example.com@192.0.2.1:80/x-nmos/registration/v1.3",
  "http://reg1.example.com@198.51.100.1:80/x-nmos/registration/v1.3",
  "http://reg1.example.com@203.0.113.1:80/x-nmos/registration/v1.3",
  ...
]

If anyone is relying on that property e.g. to populate UI, that would be an unexpected change. :-/

(However, it does also allow the existing registry_address setting to be populated in the same way, and that just works too.)