diff --git a/docs/deployment.md b/docs/deployment.md index 6826db8c5..58927d95e 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -67,8 +67,10 @@ Options: [default: 16777216] --ws-max-queue INTEGER The maximum length of the WebSocket message queue. [default: 32] - --ws-ping-interval FLOAT WebSocket ping interval [default: 20.0] - --ws-ping-timeout FLOAT WebSocket ping timeout [default: 20.0] + --ws-ping-interval FLOAT WebSocket ping interval in seconds. + [default: 20.0] + --ws-ping-timeout FLOAT WebSocket ping timeout in seconds. + [default: 20.0] --ws-per-message-deflate BOOLEAN WebSocket per-message-deflate compression [default: True] diff --git a/docs/index.md b/docs/index.md index 027e6cc28..a129e7a52 100644 --- a/docs/index.md +++ b/docs/index.md @@ -137,8 +137,10 @@ Options: [default: 16777216] --ws-max-queue INTEGER The maximum length of the WebSocket message queue. [default: 32] - --ws-ping-interval FLOAT WebSocket ping interval [default: 20.0] - --ws-ping-timeout FLOAT WebSocket ping timeout [default: 20.0] + --ws-ping-interval FLOAT WebSocket ping interval in seconds. + [default: 20.0] + --ws-ping-timeout FLOAT WebSocket ping timeout in seconds. + [default: 20.0] --ws-per-message-deflate BOOLEAN WebSocket per-message-deflate compression [default: True] diff --git a/docs/settings.md b/docs/settings.md index ed4bef52d..9c62460fe 100644 --- a/docs/settings.md +++ b/docs/settings.md @@ -70,8 +70,8 @@ Using Uvicorn with watchfiles will enable the following options (which are other * `--ws <str>` - Set the WebSockets protocol implementation. Either of the `websockets` and `wsproto` packages are supported. Use `'none'` to ignore all websocket requests. **Options:** *'auto', 'none', 'websockets', 'wsproto'.* **Default:** *'auto'*. * `--ws-max-size <int>` - Set the WebSockets max message size, in bytes. Please note that this can be used only with the default `websockets` protocol. * `--ws-max-queue <int>` - Set the maximum length of the WebSocket incoming message queue. Please note that this can be used only with the default `websockets` protocol. -* `--ws-ping-interval <float>` - Set the WebSockets ping interval, in seconds. Please note that this can be used only with the default `websockets` protocol. -* `--ws-ping-timeout <float>` - Set the WebSockets ping timeout, in seconds. Please note that this can be used only with the default `websockets` protocol. +* `--ws-ping-interval <float>` - Set the WebSockets ping interval, in seconds. Please note that this can be used only with the default `websockets` protocol. **Default:** *20.0* +* `--ws-ping-timeout <float>` - Set the WebSockets ping timeout, in seconds. Please note that this can be used only with the default `websockets` protocol. **Default:** *20.0* * `--lifespan <str>` - Set the Lifespan protocol implementation. **Options:** *'auto', 'on', 'off'.* **Default:** *'auto'*. * `--h11-max-incomplete-event-size <int>` - Set the maximum number of bytes to buffer of an incomplete event. Only available for `h11` HTTP protocol implementation. **Default:** *'16384'* (16 KB). diff --git a/uvicorn/main.py b/uvicorn/main.py index 4e4da6aa9..38d18207a 100644 --- a/uvicorn/main.py +++ b/uvicorn/main.py @@ -156,14 +156,14 @@ def print_version(ctx: click.Context, param: click.Parameter, value: bool) -> No "--ws-ping-interval", type=float, default=20.0, - help="WebSocket ping interval", + help="WebSocket ping interval in seconds.", show_default=True, ) @click.option( "--ws-ping-timeout", type=float, default=20.0, - help="WebSocket ping timeout", + help="WebSocket ping timeout in seconds.", show_default=True, ) @click.option(