From 9eb840c23319c9b6c5ef7fda3adb85f732116180 Mon Sep 17 00:00:00 2001 From: Wilfried OLLIVIER Date: Sun, 17 Feb 2019 17:45:02 +0100 Subject: [PATCH] Add support for root websocket --- README.md | 1 + defaults/main.yml | 4 +++- templates/reverse.caddy.j2 | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6c760cd..42d31ec 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ Role Variables - caddy_www: /var/www/caddy - reverse_location: reverse destination point - reverse_port: port to redirect to +- rootws: yes/no activate websocket in the / path - websocket_path: path to websocket (optional) - websocket_localtion: reverse destination point for websocket config - websocket_port: websocket port to redirect to diff --git a/defaults/main.yml b/defaults/main.yml index be6b490..78cf673 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -12,4 +12,6 @@ reverse_port: 8080 vhost_name: default -websocket: no \ No newline at end of file +websocket: no + +rootws: no \ No newline at end of file diff --git a/templates/reverse.caddy.j2 b/templates/reverse.caddy.j2 index 59856c8..1cd099d 100644 --- a/templates/reverse.caddy.j2 +++ b/templates/reverse.caddy.j2 @@ -13,6 +13,9 @@ } proxy / http://{{ reverse_location }}:{{ reverse_port }} { +{% if rootws %} + websocket +{% endif %} transparent }