Support for Unix domain socket listeners (#705)

The client already supports protocol-agnostic transport so handles
unix:/// schemes.
This commit is contained in:
Jeff Mitchell authored and GitHub committed 2020-10-16 13:45:47 -04:00
1 parent fb94971a99
commit 1f48d97327
12 files changed
+406 -81

No files matched your search

+9 -2
View File
@@ -123,7 +123,7 @@ func (c *Command) Flags() *base.FlagSets {
Name: "api-listen-address",
Target: &c.flagControllerAPIListenAddr,
EnvVar: "BOUNDARY_DEV_CONTROLLER_API_LISTEN_ADDRESS",
Usage: "Address to bind to for controller \"api\" purpose.",
Usage: "Address to bind to for controller \"api\" purpose. If this begins with a forward slash, it will be assumed to be a Unix domain socket path.",
})
f.StringVar(&base.StringVar{
@@ -160,7 +160,7 @@ func (c *Command) Flags() *base.FlagSets {
Name: "cluster-listen-address",
Target: &c.flagControllerClusterListenAddr,
EnvVar: "BOUNDARY_DEV_CONTROLLER_CLUSTER_LISTEN_ADDRESS",
Usage: "Address to bind to for controller \"cluster\" purpose.",
Usage: "Address to bind to for controller \"cluster\" purpose. If this begins with a forward slash, it will be assumed to be a Unix domain socket path.",
})
f.StringVar(&base.StringVar{
@@ -296,10 +296,17 @@ func (c *Command) Run(args []string) int {
if c.flagControllerAPIListenAddr != "" {
l.Address = c.flagControllerAPIListenAddr
}
if strings.HasPrefix(l.Address, "/") {
l.Type = "unix"
}
case "cluster":
if c.flagControllerClusterListenAddr != "" {
l.Address = c.flagControllerClusterListenAddr
c.Config.Worker.Controllers = []string{l.Address}
}
if strings.HasPrefix(l.Address, "/") {
l.Type = "unix"
}
case "proxy":