Skip to content

Added new (WSPING_INTERVAL & WSPING_TIMEOUT) env variables allowing tuning of WebSocket ping timers. #5

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ LDAP-Identification is performed using the email.
| `EXTERNAL_WEB_DNS` | Custom address for checking availability and passed to `IFRAME_PATH_FORMAT`. Should be set to the external address of the docker host | `nojava-ipmi-kvm.corporate.local` |
| `WEB_PORT_START` | The first port to be allocated to kvm containers | `8800` |
| `WEB_PORT_END` | The first port outside the range | `8900` |
| `WSPING_INTERVAL` | The interval for websocket ping requests | `5` |
| `WSPING_TIMEOUT` | The timeout for websocket ping/pong replies | `30` |
| `JAVA_IFRAME_PATH_FORMAT` | This format specifies the iframe url used for java kvm hosts, useful if you have a reverse proxy | (see section [IFRAME_PATH_FORMAT](#IFRAME_PATH_FORMAT)) |
| `HTML5_IFRAME_PATH_FORMAT` | This format specifies the iframe url used for html5 kvm hosts, useful if you have a reverse proxy | (see section [IFRAME_PATH_FORMAT](#IFRAME_PATH_FORMAT)) |
| `HTML5_AUTHORIZATION` | Authorization cookie required to access html5 consoles. `generate`: auto-generated, `use_server`: Uses the `is_admin` cookie set by server, `[key]:[value]`: Manual | `kvm_authorization:abcdefgh` |
Expand Down
5 changes: 4 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
WEBAPP_PORT = int(os.environ["WEBAPP_PORT"])
WEBAPP_BASE = os.environ["WEBAPP_BASE"]
CONFIG_PATH = os.environ.get("KVM_CONFIG_PATH", DEFAULT_CONFIG_FILEPATH)
WSPING_INTERVAL = os.environ.get("WSPING_INTERVAL", 5)
WSPING_TIMEOUT = os.environ.get("WSPING_TIMEOUT", 30)

logging.basicConfig(level=os.environ.get("LOGLEVEL", "INFO"))

Expand Down Expand Up @@ -67,7 +69,8 @@ def make_app():
"login_url": "/oauth/login",
"xsrf_cookies": True,
"default_handler_class": MainHandler,
"websocket_ping_interval": 10,
"websocket_ping_interval": WSPING_INTERVAL,
"websocket_ping_timeout": WSPING_TIMEOUT,
}
return web.Application(
[web.url(r"/oauth/login", OAuth2LoginHandler), web.url(r"/", MainHandler), web.url(r"/kvm", KVMHandler)],
Expand Down