feat: extra content option for stream block

This commit is contained in:
2023-01-11 17:49:39 +01:00
parent cc6eb21ada
commit 8218622278
2 changed files with 6 additions and 1 deletions

View File

@@ -13,6 +13,10 @@ server {
proxy_pass {{ targetip }}:$server_port;
{% endif %}
{% if extra_content %}
{{ extra_content }}
{% endif %}
{% if transparent %}
proxy_bind $remote_addr:{% if targetportoverwrite %}{{ targetportoverwrite }}{% else %}$remote_port{% endif %} transparent;
{% endif %}

3
vm.py
View File

@@ -66,6 +66,7 @@ class VM:
proto = portStruct.get("proto") or "tcp"
isUDP = proto == "udp"
proxy_timeout = portStruct.get("proxy_timeout") or "10s"
extra_content = portStruct.get("extra-content")
compositeName = "-".join((self.hostname, name, portstring, proto))
@@ -74,7 +75,7 @@ class VM:
component = template.render(targetip=self.ip, udp=isUDP, portstring=portstring,
transparent=transparent, proxy_timeout=proxy_timeout,
comment=compositeName)
comment=compositeName, extra_content=extra_content)
components.append(component)
return components