From 6fcb484f97e991ac408de96efe843bed74c6166c Mon Sep 17 00:00:00 2001 From: PiBa-NL Date: Thu, 20 Nov 2014 01:04:02 +0100 Subject: haproxy-devel, option to listen on multiple ip's ports in each frontend --- config/haproxy-devel/haproxy.inc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'config/haproxy-devel/haproxy.inc') diff --git a/config/haproxy-devel/haproxy.inc b/config/haproxy-devel/haproxy.inc index 07086bd5..930fd4e9 100644 --- a/config/haproxy-devel/haproxy.inc +++ b/config/haproxy-devel/haproxy.inc @@ -1061,7 +1061,28 @@ function haproxy_writeconf($configpath) { } fwrite ($fd, "{$frontendinfo}"); + + if (isset($bind['a_extaddr'])) { + foreach($bind['a_extaddr']['item'] as $extaddr) { + if (isset($extaddr['extaddr']) && $extaddr['extaddr'] != "") { + $ip = haproxy_interface_ip($extaddr['extaddr']); + } else + $ip = $extaddr['extaddr_custom']; + + if ($extaddr['extaddr_ssl'] == 'yes') + $ssl = $ssl_info; + else + $ssl = ""; + + $portsnumeric = group_ports(haproxy_portoralias_to_list($extaddr['extaddr_port'])); + foreach($portsnumeric as $portnumeric) { + $portnumeric = str_replace(":","-",$portnumeric); + $listenip .= "\tbind\t\t\t$ip:{$portnumeric} {$ssl} {$advanced_bind} {$extaddr['extaddr_advanced']}\n"; + } + } + } fwrite ($fd, "{$listenip}"); + if (use_frontend_as_unixsocket($bind['name'])){ fwrite ($fd, "\tbind /tmp/haproxy_chroot/{$bind['name']}.socket accept-proxy {$ssl_info} {$advanced_bind}\n"); } -- cgit v1.2.3