From 85f0c12a11ffdf837116857f814cf5c21d4e5f37 Mon Sep 17 00:00:00 2001 From: Wilfried OLLIVIER Date: Fri, 1 Feb 2019 17:45:14 +0100 Subject: [PATCH] Add websocket config support --- README.md | 4 ++++ templates/reverse.caddy.j2 | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 867e26b..63e9836 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,10 @@ Role Variables - reverse_location: reverse destination point - reverse_port: port to redirect to +- websocket_path: path to websocket (optional) +- websocket_localtion: reverse destination point for websocket config +- websocket_port: websocket port to redirect to + - vhost_name: name of the vhost Dependencies diff --git a/templates/reverse.caddy.j2 b/templates/reverse.caddy.j2 index 81df421..3c1beb2 100644 --- a/templates/reverse.caddy.j2 +++ b/templates/reverse.caddy.j2 @@ -16,6 +16,12 @@ transparent } +{% if websocket_path is defined %} + proxy {{ websocket_path }} http://{{ websocket_location }}:{{ websocket_port }} { + websocket + } +{% endif %} + log {{ caddy_logs }}/{{ vhost_name }}/access.log { rotate_size 100 rotate_age 30