support multiple --restrict-http-upgrade-path-prefix

This commit is contained in:
Σrebe - Romain GERARD 2023-12-03 22:32:05 +01:00
parent 592fab9406
commit 3eba7d8771
No known key found for this signature in database
GPG key ID: 7A42B4B97E0332F4
3 changed files with 20 additions and 9 deletions

View file

@ -161,9 +161,9 @@ struct Server {
/// Server will only accept connection from if this specific path prefix is used during websocket upgrade.
/// 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
/// Disabled by default. Accept all path prefix. Can be specified multiple time
#[arg(long, verbatim_doc_comment)]
restrict_http_upgrade_path_prefix: Option<String>,
restrict_http_upgrade_path_prefix: Option<Vec<String>>,
/// [Optional] Use custom certificate (.crt) instead of the default embedded self signed certificate.
#[arg(long, value_name = "FILE_PATH", verbatim_doc_comment)]
@ -441,7 +441,7 @@ pub struct WsServerConfig {
pub socket_so_mark: Option<i32>,
pub bind: SocketAddr,
pub restrict_to: Option<Vec<String>>,
pub restrict_http_upgrade_path_prefix: Option<String>,
pub restrict_http_upgrade_path_prefix: Option<Vec<String>>,
pub websocket_ping_frequency: Option<Duration>,
pub timeout_connect: Duration,
pub websocket_mask_frame: bool,