[pve-devel] [PATCH v3 manager 2/3] proxy: allow setting LISTEN_IP for pveproxy and spiceproxy

Oguz Bektas o.bektas at proxmox.com
Mon Mar 22 15:00:44 CET 2021


the $host variable is set to "::0" by default to listen on wildcard
(with 'Domain' => PF_INET6).

if 'LISTEN_IP' is defined in /etc/default/pveproxy, that IP will be used
instead.

Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
---
 PVE/Service/pveproxy.pm   | 4 ++--
 PVE/Service/spiceproxy.pm | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/PVE/Service/pveproxy.pm b/PVE/Service/pveproxy.pm
index 571a6bf5..4ecd442a 100755
--- a/PVE/Service/pveproxy.pm
+++ b/PVE/Service/pveproxy.pm
@@ -69,8 +69,8 @@ sub init {
     my $lockfh = IO::File->new(">>${accept_lock_fn}") ||
 	die "unable to open lock file '${accept_lock_fn}' - $!\n";
 
-    my $family = PVE::Tools::get_host_address_family($self->{nodename});
-    my $socket = $self->create_reusable_socket(8006, undef, $family);
+    my $listen_ip = $proxyconf->{LISTEN_IP} // "::0";
+    my $socket = $self->create_reusable_socket(8006, $listen_ip);
 
     my $dirs = {};
 
diff --git a/PVE/Service/spiceproxy.pm b/PVE/Service/spiceproxy.pm
index f8e06b60..24be0ed7 100755
--- a/PVE/Service/spiceproxy.pm
+++ b/PVE/Service/spiceproxy.pm
@@ -39,8 +39,8 @@ sub init {
     my $lockfh = IO::File->new(">>${accept_lock_fn}") ||
 	die "unable to open lock file '${accept_lock_fn}' - $!\n";
 
-    my $family = PVE::Tools::get_host_address_family($self->{nodename});
-    my $socket = $self->create_reusable_socket(3128, undef, $family);
+    my $listen_ip = $proxyconf->{LISTEN_IP} // "::0";
+    my $socket = $self->create_reusable_socket(3128, $listen_ip);
 
     $self->{server_config} = {
 	keep_alive => 0,
-- 
2.20.1





More information about the pve-devel mailing list