Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WiP: Introduce SNI and randomized load-balancing #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cfcs
Copy link

@cfcs cfcs commented Mar 13, 2016

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 TODO

TODO

  • This patch currently breaks support for specifying --certificate without a corresponding --key
  • This patch does not check that --certificate arguments corresponds to the names passed to --map
  • This patch does not handle wildcards in --map

@cfcs
Copy link
Author

cfcs commented Mar 13, 2016

I put "TODO" comments on parts I'm insecure about.

@cfcs cfcs force-pushed the sni_and_roundrobin branch 2 times, most recently from d0c8aea to b8c68bd Compare March 16, 2016 15:50
This commit introduces several 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]"`

This patch currently breaks support for specifying `--certificate` without a corresponding `--key` - TODO figure that out.

This patch does not check that `--certificate` corresponds to the names passed to `--map`. TODO.

This patch does not filter VT100 escape codes in SNI names printed to the log. TODO.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant