WiP: Introduce SNI and randomized load-balancing #25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a WiP, it would be great to get some comments on the code, and the issues detailed below.
It adds a dependency on the structure used to match requested SNI names with the desired backends. I didn't know if I should also merge that in, so for now it's in a git repo of its own. To test this patch you will need to pin it:
opam pin add wildcard https://github.com/cfcs/ocaml-wildcard
NOTE: If it fails to install it, make sure you have
opam install oasis2opam
This commit introduces two new parameters:
--sni
: Enable SNI and several--certificate
/--key
parameters--hostmap
: Configure mapping of SNI hosts to specific backends. If several backends are given, one is randomly selected. This parameter may be specified multiple times.Example:
"[domain 1] [domain 2] [..] = [backend:port] [backend2:port]"
Additionally it allows users to specify multiple
--certificate
/--key
pairs (introducing argument ordering significance, not sure that's a good thing). See the TODOTODO
--certificate
without a corresponding--key
--certificate
arguments corresponds to the names passed to--map
--map