Allow loading http upgrade path prefix from env

This commit is contained in:
Σrebe - Romain GERARD 2023-12-19 23:22:07 +01:00
parent 001759afac
commit 27f16984e0
No known key found for this signature in database
GPG key ID: 7A42B4B97E0332F4
3 changed files with 15 additions and 7 deletions

View file

@ -105,7 +105,12 @@ struct Client {
/// Use a specific prefix that will show up in the http path during the upgrade request.
/// Useful if you need to route requests server side but don't have vhosts
#[arg(long, default_value = "morille", verbatim_doc_comment)]
#[arg(
long,
default_value = "morille",
verbatim_doc_comment,
env = "WSTUNNEL_HTTP_UPGRADE_PATH_PREFIX"
)]
http_upgrade_path_prefix: String,
/// Pass authorization header with basic auth credentials during the upgrade request.
@ -174,7 +179,12 @@ struct Server {
/// Useful if you specify in the client a custom path prefix and you want the server to only allow this one.
/// The path prefix act as a secret to authenticate clients
/// Disabled by default. Accept all path prefix. Can be specified multiple time
#[arg(short = 'r', long, verbatim_doc_comment)]
#[arg(
short = 'r',
long,
verbatim_doc_comment,
env = "WSTUNNEL_RESTRICT_HTTP_UPGRADE_PATH_PREFIX"
)]
restrict_http_upgrade_path_prefix: Option<Vec<String>>,
/// [Optional] Use custom certificate (.crt) instead of the default embedded self signed certificate.