aboutsummaryrefslogtreecommitdiffstats
path: root/config/haproxy-devel/haproxy.inc
diff options
context:
space:
mode:
authorPiBa-NL <pba_2k3@yahoo.com>2014-11-20 01:04:02 +0100
committerPiBa-NL <pba_2k3@yahoo.com>2014-11-20 01:04:02 +0100
commit6fcb484f97e991ac408de96efe843bed74c6166c (patch)
tree3f921d778e6b93d01ad02357b8d1b7164c2edccb /config/haproxy-devel/haproxy.inc
parentf3e95b3ea13324448032a65ad9c739f56101397c (diff)
downloadpfsense-packages-6fcb484f97e991ac408de96efe843bed74c6166c.tar.gz
pfsense-packages-6fcb484f97e991ac408de96efe843bed74c6166c.tar.bz2
pfsense-packages-6fcb484f97e991ac408de96efe843bed74c6166c.zip
haproxy-devel, option to listen on multiple ip's ports in each frontend
Diffstat (limited to 'config/haproxy-devel/haproxy.inc')
-rw-r--r--config/haproxy-devel/haproxy.inc21
1 files changed, 21 insertions, 0 deletions
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");
}