fix #417: proxy: allow settnig LISTEN_IP for pveproxy and spiceproxy

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@proxmox.com>
This commit is contained in:
Oguz Bektas 2021-03-22 15:00:44 +01:00 committed by Thomas Lamprecht
parent 74b6a95945
commit e224b7d2e6
2 changed files with 4 additions and 4 deletions

View File

@ -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 = {};

View File

@ -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,