public function export() : array
{
$actions = $this->actions;
if ($this->redirect) {
$actions[] = $this->redirect;
}
$defaultPort = $this->crypto ? 443 : 80;
if (isset($this->interfaces)) {
$interfaces = array_unique($this->interfaces, SORT_REGULAR);
} else {
$interfaces = [["::", $defaultPort]];
if (self::separateIPv4Binding()) {
$interfaces[] = ["0.0.0.0", $defaultPort];
}
}
return ["interfaces" => $interfaces, "name" => $this->name, "crypto" => $this->crypto, "actions" => $actions, "httpdriver" => $this->httpDriver];
}