feat: configurate interfaces for listen directive

This commit is contained in:
2024-12-28 15:32:14 +00:00
parent 54c299c21e
commit 105ce44026
2 changed files with 23 additions and 1 deletions

6
vm.py
View File

@@ -62,6 +62,8 @@ class VM:
name = str(portStruct.get("name")).replace(" ", "")
portstring = str(portStruct.get("port")).replace(" ", "")
port_interfaces = portStruct.get("interfaces")
assert(port_interfaces is None or type(port_interfaces) == list)
transparent = portStruct.get("transparent")
proto = portStruct.get("proto") or "tcp"
isUDP = proto == "udp"
@@ -75,7 +77,9 @@ class VM:
component = template.render(targetip=self.ip, udp=isUDP, portstring=portstring,
transparent=transparent, proxy_timeout=proxy_timeout,
comment=compositeName, extra_content=extra_content)
comment=compositeName, extra_content=extra_content,
port_interfaces=port_interfaces)
components.append(component)
return components