Initial ipv6 / iptables work

This commit is contained in:
Justin SB
2014-11-03 08:04:42 -08:00
parent 808be2d13b
commit 9a053a4b59
5 changed files with 77 additions and 22 deletions

View File

@@ -100,8 +100,12 @@ func main() {
}
}
protocol := iptables.ProtocolIpv4
if net.IP(bindAddress).To4() == nil {
protocol = iptables.ProtocolIpv6
}
loadBalancer := proxy.NewLoadBalancerRR()
proxier := proxy.NewProxier(loadBalancer, net.IP(bindAddress), iptables.New(exec.New()))
proxier := proxy.NewProxier(loadBalancer, net.IP(bindAddress), iptables.New(exec.New(), protocol))
// Wire proxier to handle changes to services
serviceConfig.RegisterHandler(proxier)
// And wire loadBalancer to handle changes to endpoints to services